Skip to content

Commit

Permalink
prevent crash when handshake is null (no state schema)
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Mar 24, 2019
1 parent ce8a594 commit c07023d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "colyseus.js",
"version": "0.10.1",
"version": "0.10.2",
"description": "Multiplayer Game Client for the Browser",
"keywords": [
"colyseus",
Expand Down
2 changes: 1 addition & 1 deletion src/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class Room<State= any> {
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);
}
Expand Down

0 comments on commit c07023d

Please sign in to comment.