Stop crash when the first participant joins a room

This commit is contained in:
Kienan Stewart 2020-04-20 01:49:15 -04:00
parent f1d23e78a7
commit bebc6d4b95
1 changed files with 5 additions and 2 deletions

View File

@ -115,8 +115,11 @@ def handle_join_negotiation(json):
def get_room_participants(room):
if '/' not in socketio.server.manager.get_namespaces():
return []
try:
sessions = [s for s in socketio.server.manager.get_participants('/', room)]
participants = [p for s,p in session_map.items() if s in sessions]
except:
return []
app.logger.debug(participants)
return participants