diff options
Diffstat (limited to 'gateway/src/events/Close.ts')
-rw-r--r-- | gateway/src/events/Close.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gateway/src/events/Close.ts b/gateway/src/events/Close.ts index b4fed316..2f274ec4 100644 --- a/gateway/src/events/Close.ts +++ b/gateway/src/events/Close.ts @@ -4,7 +4,7 @@ import { Session } from "@fosscord/util"; export async function Close(this: WebSocket, code: number, reason: string) { console.log("[WebSocket] closed", code, reason); - await Session.delete({ session_id: this.session_id }); + if (this.session_id) await Session.delete({ session_id: this.session_id }); // @ts-ignore this.off("message", Message); } |