From 0c4f8130f68e48e515756d4b0e038e1e6be8ab03 Mon Sep 17 00:00:00 2001 From: Rayan fernandes <37145078+Rayanfer32@users.noreply.github.com> Date: Fri, 11 Jun 2021 23:40:08 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20catch=20thumbnail=20out=20of=20b?= =?UTF-8?q?ounds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/thumbnail_view.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/thumbnail_view.py b/app/views/thumbnail_view.py index 16f819a..737c9f6 100644 --- a/app/views/thumbnail_view.py +++ b/app/views/thumbnail_view.py @@ -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,