From ca11153a36c502e255d5926289448a6372840a58 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 16 Dec 2021 23:59:53 +0000 Subject: [PATCH] Sequence --- newswire.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newswire.py b/newswire.py index a54a74b3a..0d8c26400 100644 --- a/newswire.py +++ b/newswire.py @@ -153,14 +153,14 @@ def _downloadNewswireFeedFavicon(session, baseDir: str, timeoutSec = 10 imageData, mimeType = \ getImageBinaryFromUrl(session, favUrl, timeoutSec, debug) + if not imageData: + return False if 'image/png' in mimeType: favUrl = favUrl.replace('.ico', '.png') elif 'image/webp' in mimeType: favUrl = favUrl.replace('.ico', '.webp') elif 'image/gif' in mimeType: favUrl = favUrl.replace('.ico', '.gif') - if not imageData: - return False if not os.path.isdir(baseDir + '/favicons'): os.mkdir(baseDir + '/favicons') linkFilename = favUrl.replace('/', '-')