🥅 catch thumbnail out of bounds

This commit is contained in:
Rayan fernandes 2021-06-11 23:40:08 +05:30
parent db5e09d9a5
commit 0c4f8130f6
1 changed files with 6 additions and 1 deletions

View File

@ -46,7 +46,12 @@ class ThumbnailView:
body = temp.getvalue()
else:
thumb_pos = int(len(thumbnails) / 2)
thumbnail = self.client._get_thumb(thumbnails, thumb_pos)
try:
thumbnail = self.client._get_thumb(thumbnails, thumb_pos)
except Exception as e:
logging.debug(e)
thumbnail = None
if not thumbnail or isinstance(thumbnail, types.PhotoSizeEmpty):
return web.Response(
status=410,