Ver código fonte

Fix thumbnail_img NoneType error (#2941)

### What problem does this PR solve?

fix thumbnail_img NoneType error

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.13.0
wwwlll 1 ano atrás
pai
commit
6a4858a7ee
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 5 adições e 2 exclusões
  1. 5
    2
      api/utils/file_utils.py

+ 5
- 2
api/utils/file_utils.py Ver arquivo

@@ -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):

Carregando…
Cancelar
Salvar