From b47b9ea9511db6330db22c8abfd67658323430ea Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 19 Jul 2016 10:51:03 +0200 Subject: QML: Band-aid fix to prevent a crash If the document that FindExportedCppTypes is to search is not in the snapshot, skip over it (instead of passing the shared pointer with a null-value inside). Change-Id: I462e3d22aa4e1cc51e710c75ae0f9399c151240b Reviewed-by: Ulf Hermann Reviewed-by: Nikolai Kosjar --- src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.cpp') diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index a919087fea..bdd6e6eeab 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -1321,7 +1321,10 @@ void ModelManagerInterface::updateCppQmlTypes(QFutureInterface &interface, if (!scan) { hasNewInfo = newData.remove(fileName) > 0 || hasNewInfo; foreach (const QString &file, newDeclarations[fileName]) { - finder(snapshot.document(file)); + CPlusPlus::Document::Ptr doc = snapshot.document(file); + if (doc.isNull()) + continue; + finder(doc); hasNewInfo = rescanExports(file, finder, newData) || hasNewInfo; } continue; -- cgit v1.2.1