diff --git a/packages/nakama-js/socket.ts b/packages/nakama-js/socket.ts index ad3aef3..c96894c 100644 --- a/packages/nakama-js/socket.ts +++ b/packages/nakama-js/socket.ts @@ -846,7 +846,10 @@ export class DefaultSocket implements Socket { } this.adapter.onError = (evt: Event) => { reject(evt); - this.adapter.close(); + + if (this.adapter.isOpen()) { + this.adapter.close(); + } }