Edit book: Fix regression in calibre 5 that caused an error when managing user dictionaries. Fixes #1903294 [Preferences / Editor settings / Manage spelling dictionaries throws exception](https://bugs.launchpad.net/calibre/+bug/1903294)

This commit is contained in:
Kovid Goyal 2020-11-06 18:16:48 +05:30
parent 7c91fc2bb7
commit 238ff455f7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -502,7 +502,7 @@ class ManageDictionaries(Dialog): # {{{
if countrycode == best_country:
j.setData(0, Qt.FontRole, bf)
pd = get_dictionary(DictionaryLocale(lc, countrycode))
for dictionary in sorted(languages[lc][countrycode], key=lambda d:d.name):
for dictionary in sorted(languages[lc][countrycode], key=lambda d:(d.name or '')):
k = QTreeWidgetItem(j, DICTIONARY)
pl = calibre_langcode_to_name(dictionary.primary_locale.langcode)
if dictionary.primary_locale.countrycode: