Fix for AMQ-4857, added test for null before accessing protocol string

This commit is contained in:
Kevin Earls 2013-11-08 18:03:56 +01:00
parent 42e1c463d4
commit 692428eee5
1 changed files with 1 additions and 1 deletions

View File

@ -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();