X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/31006b86a2e9883d8a4c5fe18128821b325773ab..01949e093709031e945a469aa30d983666c0ce59:/apps/fileupload/views.py?ds=inline diff --git a/apps/fileupload/views.py b/apps/fileupload/views.py index 89ccf081..35e0a7ae 100644 --- a/apps/fileupload/views.py +++ b/apps/fileupload/views.py @@ -23,7 +23,11 @@ except ImportError: else: def thumbnail(relpath): try: - return default.backend.get_thumbnail(relpath, "x50").url + thumb = default.backend.get_thumbnail(relpath, "x50") + if not thumb.exists(): + # That's not an image. No thumb. + return None + return thumb.url except IOError: # That's not an image. No thumb. return None