From 8e596603d0a652f85bbd6171bfceb7faa59ec4ec Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 20 Dec 2020 17:43:55 +0000 Subject: [PATCH] Test that image exists before returning themed version --- webapp_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp_utils.py b/webapp_utils.py index 46d332a73..a61ba4222 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -484,9 +484,11 @@ def getImageFile(baseDir: str, name: str, directory: str, bannerFile = '' bannerFilename = '' for ext in bannerExtensions: - bannerFile = name + '_' + theme + '.' + ext + bannerFile = name + '.' + ext bannerFilename = directory + '/' + bannerFile if os.path.isfile(bannerFilename): + bannerFile = name + '_' + theme + '.' + ext + bannerFilename = directory + '/' + bannerFile break return bannerFile, bannerFilename