Check that dictionary was loaded

merge-requests/30/head
Bob Mottram 2021-11-01 23:42:37 +00:00
parent 424ba85942
commit 7a88dea618
1 changed files with 6 additions and 6 deletions

View File

@ -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 += '<center><h5>' + \
translate['No results'] + '</h5></center>'
emojiForm += htmlFooter()
return emojiForm
emojiForm += '<center><h5>' + \
translate['No results'] + '</h5></center>'
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: