hopefully fix promise rejection for session counter

This commit is contained in:
hippoz 2021-06-27 14:04:50 +03:00
parent f064f7b1be
commit ee04d03bdb
Signed by: hippoz
GPG key ID: 7C52899193467641

View file

@ -74,7 +74,7 @@ class GatewayServer extends EventEmitter {
ws.alive = true;
});
ws.on("close", async () => {
if (this.sessionCounters[ws.session.user._id] <= 1) {
if (ws.session.user && this.sessionCounters[ws.session.user._id] <= 1) {
this.inChannel(ws.channels[0], (client) => {
console.log(client.session);
client.send(packet("EVENT_CHANNEL_MEMBERS", {