From a33960c91c5dc364b630e814bf0667a03ab378a2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 24 May 2016 10:31:08 +0530 Subject: [PATCH] ... --- src/calibre/gui2/tweak_book/editor/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index 62221bbf72..c2b6cb0551 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -392,7 +392,7 @@ class TextEdit(PlainTextEdit): c.setPosition(c.position() + string_length(word), c.KeepAnchor) if self.smarts.verify_for_spellcheck(c, self.highlighter): locale = self.spellcheck_locale_for_cursor(c) - if not lang or (locale and lang == locale.langcode): + if not lang or not locale or (locale and lang == locale.langcode): self.setTextCursor(c) if center_on_cursor: self.centerCursor()