# HG changeset patch # User Matthew Wild # Date 1574782141 0 # Node ID 926d6086a95a0bc42dcd2905e430b0a12bca009d # Parent fa11070c2cd73ba5b54972ce06acd38ce865eb54 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. diff -r fa11070c2cd7 -r 926d6086a95a net/websocket.lua --- 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);