diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 4ca53d2ce3b..caa2831f7d1 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -597,6 +597,10 @@ void QmlJSEditorDocumentPrivate::updateOutlineModel() static void cleanMarks(QVector *marks, TextEditor::TextDocument *doc) { + // if doc is null, this method is improperly called, so better do nothing that leave an + // inconsistent state where marks are cleared but not removed from doc. + if (!marks || !doc) + return; for (TextEditor::TextMark *mark : *marks) { doc->removeMark(mark); delete mark;