X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/31006b86a2e9883d8a4c5fe18128821b325773ab..e3d6e94589c1356d3f8d1b7fc36d9f21d966e16a:/apps/fileupload/views.py?ds=sidebyside 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