summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2020-09-12 23:56:29 +0200
committerOlivier Gayot <olivier.gayot@sigexec.com>2020-09-12 23:56:29 +0200
commit6157c88b1e7e47dfa9233776aa25b716e62f8af2 (patch)
tree8fd36232330c02128a6454a52b155917c2e6263d
parent306d7fbfd145b3f147611bdcf651530bfb4d808f (diff)
Handle JSON with no opcode
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
-rw-r--r--swiftstory/SwiftStory.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/swiftstory/SwiftStory.py b/swiftstory/SwiftStory.py
index de2a085..770e347 100644
--- a/swiftstory/SwiftStory.py
+++ b/swiftstory/SwiftStory.py
@@ -20,7 +20,7 @@ def message_received_handler(client, message):
except json.JSONDecodeError:
return error('badly formatted json')
- op = json_msg['op']
+ op = json_msg.get('op')
if op == 'join_game':
try:
game_name = json_msg['game_name']