diff --git a/appservice.py b/appservice.py index e766e8a..ed207c6 100644 --- a/appservice.py +++ b/appservice.py @@ -201,8 +201,14 @@ def raw_from_event(event): value['url'] = url value['title'] = event['content']['body'] if 'info' in event['content']: - value['width'] = event['content']['info']['w'] - value['height'] = event['content']['info']['h'] + if 'w' in event['content']['info']: + value['width'] = event['content']['info']['w'] + else: + value['width'] = 200 + if 'h' in event['content']['info']: + value['height'] = event['content']['info']['h'] + else: + value['height'] = 200 if 'thumbnail_info' in event['content']['info']: value['thumbnail_url'] = app.config['MATRIX_HOST'] + '/_matrix/media/r0/download/' + event['content']['info']['thumbnail_url'][6:] value['thumbnail_width'] = event['content']['info']['thumbnail_info']['w']