diff --git a/src/calibre/gui2/tweak_book/editor/widget.py b/src/calibre/gui2/tweak_book/editor/widget.py index 420b60e3d2..7fc2bf2768 100644 --- a/src/calibre/gui2/tweak_book/editor/widget.py +++ b/src/calibre/gui2/tweak_book/editor/widget.py @@ -543,7 +543,7 @@ class Editor(QMainWindow): c.setPosition(orig_pos - utf16_length(word)) found = False self.editor.setTextCursor(c) - if self.editor.find_spell_word([word], locale.langcode, center_on_cursor=False): + if locale and self.editor.find_spell_word([word], locale.langcode, center_on_cursor=False): found = True fc = self.editor.textCursor() if fc.position() < c.position():