From b37323253894e8acc3af2293e0d91de624f06341 Mon Sep 17 00:00:00 2001 From: Denny Weinberg Date: Sat, 3 Jun 2017 20:27:49 +0200 Subject: [PATCH] Actions can be missing Handle the case when actions are missing in the payload --- fbchat/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbchat/client.py b/fbchat/client.py index bfdcc03..bb93d80 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -621,7 +621,7 @@ class Client(object): return None messages = [] - for message in j['payload']['actions']: + for message in j['payload'].get('actions', []): messages.append(Message(**message)) return list(reversed(messages))