summaryrefslogtreecommitdiff
path: root/swiftstory
diff options
context:
space:
mode:
Diffstat (limited to 'swiftstory')
-rw-r--r--swiftstory/SwiftStory.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/swiftstory/SwiftStory.py b/swiftstory/SwiftStory.py
index 770e347..dc55e2a 100644
--- a/swiftstory/SwiftStory.py
+++ b/swiftstory/SwiftStory.py
@@ -20,7 +20,11 @@ def message_received_handler(client, message):
except json.JSONDecodeError:
return error('badly formatted json')
- op = json_msg.get('op')
+ try:
+ op = json_msg['op']
+ except (KeyError, TypeError):
+ op = None
+
if op == 'join_game':
try:
game_name = json_msg['game_name']