Skip to content

Commit

Permalink
Return if no document contained in media document event
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Feb 14, 2024
1 parent 77cbbeb commit 150bf5e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mautrix_telegram/portal_util/message_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 150bf5e

Please sign in to comment.