aboutsummaryrefslogtreecommitdiffstats
path: root/net/websocket.lua
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
commit3dea196a532763136bda9ebae0c3195e8862081f (patch)
treefc006249e79d7c2b281ce8cdcf4ab66739bb3137 /net/websocket.lua
parenta98badef8ed87aac870ed5e95e0fdc74df340231 (diff)
downloadprosody-3dea196a532763136bda9ebae0c3195e8862081f.tar.gz
prosody-3dea196a532763136bda9ebae0c3195e8862081f.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/websocket.lua')
-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);