From d862af504de1c678420f91f8408d199c20f25a1b Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 26 May 2020 00:56:43 +0100 Subject: [PATCH] Check user is in a room before flushing their overdose key --- houdini/handlers/games/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/houdini/handlers/games/__init__.py b/houdini/handlers/games/__init__.py index cacc92b..a4140f9 100644 --- a/houdini/handlers/games/__init__.py +++ b/houdini/handlers/games/__init__.py @@ -47,7 +47,7 @@ async def handle_overdose_key(p, room: Room): @handlers.disconnected @handlers.player_attribute(joined_world=True) async def disconnect_overdose_key(p): - if p.room.game: + if p.room is not None and p.room.game: overdose_key = f'{p.id}.overdose' await p.server.redis.delete(overdose_key)