From be70ff8a695713fdbb324c37d7837b2f59920fb7 Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Fri, 1 Dec 2023 13:29:25 +0000 Subject: [PATCH] Return if no document contained in media document event --- mautrix_telegram/portal_util/message_convert.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mautrix_telegram/portal_util/message_convert.py b/mautrix_telegram/portal_util/message_convert.py index b89e9dc6..8b61a702 100644 --- a/mautrix_telegram/portal_util/message_convert.py +++ b/mautrix_telegram/portal_util/message_convert.py @@ -490,6 +490,9 @@ async def _convert_document( ) -> ConvertedMessage | None: document = evt.media.document + if not document: + return None + attrs = _parse_document_attributes(document.attributes) if document.size > self.matrix.media_config.upload_size: