diff --git a/src/calibre/spell/dictionary.py b/src/calibre/spell/dictionary.py index fd2720d915..2b9eaa4523 100644 --- a/src/calibre/spell/dictionary.py +++ b/src/calibre/spell/dictionary.py @@ -243,7 +243,7 @@ class Dictionaries(object): def add_user_words(self, words, langcode): for d in self.dictionaries.itervalues(): - if d.primary_locale.langcode == langcode: + if getattr(d.primary_locale, 'langcode', None) == langcode: for word in words: d.obj.add(word)