aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-05-15 16:24:49 -0700
committerAdam Soltys <[email protected]>2020-05-15 16:24:49 -0700
commit25894616c28dea26fa2457f567abba0a40847299 (patch)
tree08ceaba3b3122b3c63145b8bf15d5bfa98c5923c /lib
parentbb8953c8e206a059f46ad4906796139346046b29 (diff)
downloadcoinos-server-25894616c28dea26fa2457f567abba0a40847299.tar.gz
coinos-server-25894616c28dea26fa2457f567abba0a40847299.zip
catch close error
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);
});
});