aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmljseditor
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-06-11 16:01:18 +0200
committerEike Ziller <eike.ziller@qt.io>2018-06-11 16:01:18 +0200
commit9b43b55dc0ac4457d05da0c422854754addc2aa9 (patch)
tree84b924487688c15ef1329aab77a316489136df7f /src/plugins/qmljseditor
parent168e89e0a2bd475a4f4b7bf4aa6f207466e8a9bd (diff)
parent4cba1d7c71484cc7250d9a7b12efa174817bdc95 (diff)
Merge remote-tracking branch 'origin/4.7'
Diffstat (limited to 'src/plugins/qmljseditor')
-rw-r--r--src/plugins/qmljseditor/qmljseditordocument.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp
index 03f5904981..9345042c11 100644
--- a/src/plugins/qmljseditor/qmljseditordocument.cpp
+++ b/src/plugins/qmljseditor/qmljseditordocument.cpp
@@ -595,6 +595,10 @@ void QmlJSEditorDocumentPrivate::updateOutlineModel()
static void cleanMarks(QVector<TextEditor::TextMark *> *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;