From bebc6d4b95f8fb837298233e2b62b9b92c54f3d5 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Mon, 20 Apr 2020 01:49:15 -0400 Subject: [PATCH] Stop crash when the first participant joins a room --- negotiation.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/negotiation.py b/negotiation.py index 22cc1ca..3dcfecf 100755 --- a/negotiation.py +++ b/negotiation.py @@ -115,8 +115,11 @@ def handle_join_negotiation(json): def get_room_participants(room): if '/' not in socketio.server.manager.get_namespaces(): return [] - sessions = [s for s in socketio.server.manager.get_participants('/', room)] - participants = [p for s,p in session_map.items() if s in sessions] + 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