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 Dec 1, 2023
1 parent 562f646 commit be70ff8
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 be70ff8

Please sign in to comment.