diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameDecoder.java index f88229fcdf..bd48f33c7a 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameDecoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameDecoder.java @@ -60,12 +60,17 @@ public class WebSocket00FrameDecoder extends ReplayingDecoder implements W // Decode a frame otherwise. byte type = in.readByte(); + WebSocketFrame frame; if ((type & 0x80) == 0x80) { // If the MSB on type is set, decode the frame length - out.add(decodeBinaryFrame(ctx, type, in)); + frame = decodeBinaryFrame(ctx, type, in); } else { // Decode a 0xff terminated UTF-8 string - out.add(decodeTextFrame(ctx, in)); + frame = decodeTextFrame(ctx, in); + } + + if (frame != null) { + out.add(frame); } }