aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sockets.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sockets.js b/lib/sockets.js
index 40e50a37..874cafcc 100644
--- a/lib/sockets.js
+++ b/lib/sockets.js
@@ -57,7 +57,7 @@ wss.on("connection", function (ws) {
ws.on("close", function () {
const username = names[id];
- if (sockets[username][id] !== undefined) delete sockets[username][id];
+ if (sockets[username] && sockets[username][id]) delete sockets[username][id];
l.info("socket closed", username);
});
});