diff options
author | Matthew Wild <mwild1@gmail.com> | 2019-11-26 15:29:01 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2019-11-26 15:29:01 +0000 |
commit | 09cdcfc0a16645fba2af58682352163853063224 (patch) | |
tree | fc006249e79d7c2b281ce8cdcf4ab66739bb3137 | |
parent | e8f099babcb585312a64d604e4c79f003c3b562b (diff) | |
download | prosody-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.
-rw-r--r-- | net/websocket.lua | 1 |
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); |