summary refs log tree commit diff
path: root/gateway
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-03 15:57:29 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-03 15:57:29 +0200
commit991e01809bf69b2198f05d24246d9c4e61454efb (patch)
treec4f8ca987b91138f672859469c94f6ba7ecb8bb0 /gateway
parentFix to send the voice leave event only to the right session (diff)
downloadserver-991e01809bf69b2198f05d24246d9c4e61454efb.tar.xz
:bug: only delete session id for authenticated connections
Diffstat (limited to 'gateway')
-rw-r--r--gateway/src/events/Close.ts2
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);
 }