Skip to content

Commit e18a1f1

Browse files
Fix commands crashing client when disconnected
1 parent 5b7e19f commit e18a1f1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

client/loader.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ Module.executeCommand = execCtx => {
257257
if(!Module.commandDefinitions.find(({ id }) => id === tokens[0])) {
258258
throw `${Module.executionCallbackMap[tokens]} for command ${cmd} is an invalid callback`;
259259
}
260+
261+
if (Game.socket.readyState !== WebSocket.OPEN) return;
262+
260263
return Game.socket.send(new Uint8Array([
261264
6,
262265
...Encoder.encode(tokens[0]), 0,

0 commit comments

Comments
 (0)