Add extra checks for getting messages

This commit is contained in:
Mark Veidemanis 2022-01-11 21:16:49 +00:00
parent bd48bf37f5
commit 4b07ad9065
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 3 additions and 0 deletions

View File

@ -170,6 +170,9 @@ class Agora(object):
messages = self.agora.recent_messages()
if not messages["success"]:
return False
if not "data" in messages["response"]:
self.log.error("Data not in messages response: {content}", content=messages["response"])
return False
open_tx = self.tx.get_ref_map().keys()
for message in messages["response"]["data"]["message_list"]:
contact_id = message["contact_id"]