diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 85a3f75d..005c6ffa 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -705,6 +705,10 @@ class GuiDocEditor(QTextEdit): def insertText(self, theInsert): """Insert a specific type of text at the cursor position. """ + if self.theHandle is None: + logger.error("No document open") + return False + if isinstance(theInsert, str): theText = theInsert elif isinstance(theInsert, nwDocInsert):