diff --git a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/JsrSession.java b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/JsrSession.java index 34a9b479a84..ab62677625d 100644 --- a/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/JsrSession.java +++ b/jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/JsrSession.java @@ -254,7 +254,12 @@ public class JsrSession extends WebSocketSession implements javax.websocket.Sess @Override public String getNegotiatedSubprotocol() { - return getUpgradeResponse().getAcceptedSubProtocol(); + String acceptedSubProtocol = getUpgradeResponse().getAcceptedSubProtocol(); + if (acceptedSubProtocol == null) + { + return ""; + } + return acceptedSubProtocol; } @Override