attempt to handle lack of image info in event #32

This commit is contained in:
Morgan McMillian 2018-05-10 07:30:14 -07:00
parent fe4d59811c
commit 632b69f75b

View file

@ -65,6 +65,7 @@ def on_receive_events(transaction):
value = {"type": "photo", "version": "1.0"} value = {"type": "photo", "version": "1.0"}
value["title"] = event['content']['body'] value["title"] = event['content']['body']
value["url"] = imgurl value["url"] = imgurl
if 'info' in event['content']:
if 'w' in event['content']['info']: if 'w' in event['content']['info']:
value["width"] = event['content']['info']['w'] value["width"] = event['content']['info']['w']
else: else: