fix(lounge): fix KeyError for ended realtime room

This commit is contained in:
MingxuanGame
2025-08-10 15:13:33 +00:00
parent fac16bde86
commit a087b0de2e

View File

@@ -80,8 +80,11 @@ async def get_all_rooms(
for room in db_rooms:
resp = await RoomResp.from_db(room, db)
if category == RoomCategory.REALTIME:
resp.has_password = bool(
MultiplayerHubs.rooms[room.id].room.settings.password.strip()
mp_room = MultiplayerHubs.rooms.get(room.id)
resp.has_password = (
bool(mp_room.room.settings.password.strip())
if mp_room is not None
else False
)
resp.category = RoomCategory.NORMAL
resp_list.append(resp)