Don't allow inserts when no document is open

This commit is contained in:
Veronica K. B. Olsen
2020-11-01 18:14:43 +01:00
parent 4102f5cc97
commit f35b1c0ad6
+4
View File
@@ -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):