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.
--- a/net/websocket.lua Tue Nov 26 00:12:51 2019 +0100
+++ b/net/websocket.lua Tue Nov 26 15:29:01 2019 +0000
@@ -23,6 +23,7 @@
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);