diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 3015e337..c1079489 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -1492,7 +1492,7 @@ def extract_apk_icons(icon_filename, apk, apkzip, repo_dir): logging.warning(_("Failed reading {path}: {error}") .format(path=icon_path, error=e)) finally: - if im: + if im and hasattr(im, 'close'): im.close() if apk['icons']: