aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2019-11-26 15:29:01 +0000
committerMatthew Wild <mwild1@gmail.com>2019-11-26 15:29:01 +0000
commit09cdcfc0a16645fba2af58682352163853063224 (patch)
treefc006249e79d7c2b281ce8cdcf4ab66739bb3137 /net
parente8f099babcb585312a64d604e4c79f003c3b562b (diff)
downloadprosody-09cdcfc0a16645fba2af58682352163853063224.tar.gz
prosody-09cdcfc0a16645fba2af58682352163853063224.zip
net.websocket: Fix traceback in case of ondisconnect being called twice
We want to figure out what situations the double ondisconnect happens in, and aim to fix the root cause in the future.
Diffstat (limited to 'net')
-rw-r--r--net/websocket.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/websocket.lua b/net/websocket.lua
index fb16b8bb..193cd556 100644
--- a/net/websocket.lua
+++ b/net/websocket.lua
@@ -23,6 +23,7 @@ local websockets = {};
local websocket_listeners = {};
function websocket_listeners.ondisconnect(conn, err)
local s = websockets[conn];
+ if not s then return; end
websockets[conn] = nil;
if s.close_timer then
timer.stop(s.close_timer);