diff --git a/api/utils/file_utils.py b/api/utils/file_utils.py index 2428f3f21..32ead6cc7 100644 --- a/api/utils/file_utils.py +++ b/api/utils/file_utils.py @@ -199,8 +199,11 @@ def thumbnail_img(filename, blob): def thumbnail(filename, blob): img = thumbnail_img(filename, blob) - return IMG_BASE64_PREFIX + \ - base64.b64encode(img).decode("utf-8") + if img is not None: + return IMG_BASE64_PREFIX + \ + base64.b64encode(img).decode("utf-8") + else: + return '' def traversal_files(base): for root, ds, fs in os.walk(base):