Test that image exists before returning themed version

merge-requests/8/head
Bob Mottram 2020-12-20 17:43:55 +00:00
parent dc47b9015f
commit 8e596603d0
1 changed files with 3 additions and 1 deletions

View File

@ -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