diff --git a/package.json b/package.json index c3ece64..c2d768d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "colyseus.js", - "version": "0.10.1", + "version": "0.10.2", "description": "Multiplayer Game Client for the Browser", "keywords": [ "colyseus", diff --git a/src/Room.ts b/src/Room.ts index f8e1d3f..96a4140 100644 --- a/src/Room.ts +++ b/src/Room.ts @@ -141,7 +141,7 @@ export class Room { this.serializer = new serializer(); } - if (this.serializer.handshake) { + if (view.buffer.byteLength > offset && this.serializer.handshake) { const bytes = Array.from(new Uint8Array(view.buffer.slice(offset))); this.serializer.handshake(bytes); }