diff options
Diffstat (limited to 'gateway/src/util/Send.ts')
-rw-r--r-- | gateway/src/util/Send.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gateway/src/util/Send.ts b/gateway/src/util/Send.ts index 4defa898..196d4205 100644 --- a/gateway/src/util/Send.ts +++ b/gateway/src/util/Send.ts @@ -18,6 +18,9 @@ export async function Send(socket: WebSocket, data: Payload) { } return new Promise((res, rej) => { + if (socket.readyState !== 1) { + return rej("socket not open"); + } socket.send(buffer, (err: any) => { if (err) return rej(err); return res(null); |