Check user is in a room before flushing their overdose key

This commit is contained in:
Ben 2020-05-26 00:56:43 +01:00
parent d805de1dfb
commit d862af504d

View File

@ -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)