diff --git a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java index 5ebbfa9dfef1..315ccbb53302 100644 --- a/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java +++ b/jetty-websocket/websocket-javax-common/src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxWebSocketFrameHandler.java @@ -596,9 +596,10 @@ private void acceptMessage(Frame frame, Callback callback) } // Accept the payload into the message sink - activeMessageSink.accept(frame, callback); + MessageSink messageSink = activeMessageSink; if (frame.isFin()) activeMessageSink = null; + messageSink.accept(frame, callback); } public void onPing(Frame frame, Callback callback) diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java index e002794c012f..c882b20f4ea2 100644 --- a/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java +++ b/jetty-websocket/websocket-jetty-common/src/main/java/org/eclipse/jetty/websocket/common/JettyWebSocketFrameHandler.java @@ -345,9 +345,10 @@ private void acceptMessage(Frame frame, Callback callback) } // Accept the payload into the message sink - activeMessageSink.accept(frame, callback); + MessageSink messageSink = activeMessageSink; if (frame.isFin()) activeMessageSink = null; + messageSink.accept(frame, callback); } private void onBinaryFrame(Frame frame, Callback callback)