From 6157c88b1e7e47dfa9233776aa25b716e62f8af2 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 12 Sep 2020 23:56:29 +0200 Subject: Handle JSON with no opcode Signed-off-by: Olivier Gayot --- swiftstory/SwiftStory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'swiftstory') 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'] -- cgit v1.2.3