From 30a6dd62ef027eb12123a954b1a6f14ca1352589 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 29 Nov 2018 12:28:23 +0200 Subject: [PATCH] Don't try to remove websocket from log listeners if it had not been added --- maubot/management/api/log.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/maubot/management/api/log.py b/maubot/management/api/log.py index bead189..fee233f 100644 --- a/maubot/management/api/log.py +++ b/maubot/management/api/log.py @@ -133,7 +133,8 @@ async def log_websocket(request: web.Request) -> web.WebSocketResponse: await ws.close() except Exception: pass - handler.listeners.remove(ws) + if authenticated: + handler.listeners.remove(ws) log.debug(f"Connection from {request.remote} closed") sockets.remove(ws) return ws