From 692428eee5f7af1118881c1140ff45cd33e99d18 Mon Sep 17 00:00:00 2001 From: Kevin Earls Date: Fri, 8 Nov 2013 18:03:56 +0100 Subject: [PATCH] Fix for AMQ-4857, added test for null before accessing protocol string --- .../main/java/org/apache/activemq/transport/ws/WSServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();