Skip to content

Commit

Permalink
Don't attempt thumb download if there is no thumb
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Jul 22, 2023
1 parent 438aff3 commit 131f021
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions telethon/client/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,9 @@ async def _download_document(
else:
file = self._get_proper_filename(file, 'photo', '.jpg', date=date)
size = self._get_thumb(document.thumbs, thumb)
if not size or isinstance(size, types.PhotoSizeEmpty):
return

if isinstance(size, (types.PhotoCachedSize, types.PhotoStrippedSize)):
return self._download_cached_photo_size(size, file)

Expand Down

0 comments on commit 131f021

Please sign in to comment.