diff --git a/src/main/java/com/corundumstudio/socketio/protocol/PacketDecoder.java b/src/main/java/com/corundumstudio/socketio/protocol/PacketDecoder.java index 4473bff..c2e101b 100644 --- a/src/main/java/com/corundumstudio/socketio/protocol/PacketDecoder.java +++ b/src/main/java/com/corundumstudio/socketio/protocol/PacketDecoder.java @@ -302,10 +302,12 @@ public class PacketDecoder { if (packet.getSubType() == PacketType.EVENT || packet.getSubType() == PacketType.BINARY_EVENT) { - ByteBufInputStream in = new ByteBufInputStream(frame); - Event event = jsonSupport.readValue(packet.getNsp(), in, Event.class); - packet.setName(event.getName()); - packet.setData(event.getArgs()); + if (!packet.hasAttachments() || packet.isAttachmentsLoaded()) { + ByteBufInputStream in = new ByteBufInputStream(frame); + Event event = jsonSupport.readValue(packet.getNsp(), in, Event.class); + packet.setName(event.getName()); + packet.setData(event.getArgs()); + } } } }