diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/WSServlet.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/WSServlet.java index f5ace832aa..d0ed22da92 100644 --- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/WSServlet.java +++ b/activemq-http/src/main/java/org/apache/activemq/transport/ws/WSServlet.java @@ -51,7 +51,7 @@ public class WSServlet extends WebSocketServlet { @Override public WebSocket doWebSocketConnect(HttpServletRequest request, String protocol) { WebSocket socket; - if (protocol.startsWith("mqtt")) { + if (protocol != null && protocol.startsWith("mqtt")) { socket = new MQTTSocket(); } else { socket = new StompSocket();