From 7a88dea6187b114784f9e168b7ef1179cc354516 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 1 Nov 2021 23:42:37 +0000 Subject: [PATCH] Check that dictionary was loaded --- webapp_search.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/webapp_search.py b/webapp_search.py index 629cad276..b823e03d1 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -71,17 +71,17 @@ def htmlSearchEmoji(cssCache: {}, translate: {}, # does the lookup file exist? if not os.path.isfile(emojiLookupFilename): - if not os.path.isfile(customEmojiLookupFilename): - emojiForm += '
' + \ - translate['No results'] + '
' - emojiForm += htmlFooter() - return emojiForm + emojiForm += '
' + \ + translate['No results'] + '
' + emojiForm += htmlFooter() + return emojiForm emojiJson = loadJson(emojiLookupFilename) if emojiJson: if os.path.isfile(customEmojiLookupFilename): customEmojiJson = loadJson(customEmojiLookupFilename) - emojiJson = dict(emojiJson, **customEmojiJson) + if customEmojiJson: + emojiJson = dict(emojiJson, **customEmojiJson) results = {} for emojiName, filename in emojiJson.items(): if searchStr in emojiName: