summary refs log tree commit diff
path: root/gateway/src/util/Send.ts
diff options
context:
space:
mode:
authorMr2u <46743919+Mr2u@users.noreply.github.com>2021-10-13 19:33:39 +1100
committerGitHub <noreply@github.com>2021-10-13 19:33:39 +1100
commit625853a47ed187c1788d21671e1151b1fa6f68a0 (patch)
treeadf0a01f6aceb59220bf3f366f94a89db48f8b83 /gateway/src/util/Send.ts
parentadded route /guilds/:id/prune GET count and POST prune. (diff)
parent:pencil: improve logging (diff)
downloadserver-625853a47ed187c1788d21671e1151b1fa6f68a0.tar.xz
Merge branch 'fosscord:master' into master
Diffstat (limited to 'gateway/src/util/Send.ts')
-rw-r--r--gateway/src/util/Send.ts3
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);