From 7ed89dd111ca4b733f77c99c84f9fc35f1aa4e86 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 10 Apr 2024 05:05:56 +0200 Subject: [PATCH] fix error when joining and leaving chat instantly before heartbeat happens --- files/routes/chat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/routes/chat.py b/files/routes/chat.py index 1d281223e..a4ecd9ca5 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -250,7 +250,9 @@ def disconnect(v): typing[room].remove(v.username) leave_room(room) - refresh_online(room) + + if online.get(room): + refresh_online(room) commit_and_close()