From e065107fa537238aa65c097d24b649a0de9f5f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Tue, 6 Jul 2021 14:04:33 +0200 Subject: QmlJSTools: Guard against null pointer access Fixes: QTCREATORBUG-25943 Change-Id: If9e6528b0dc5642dbd150e7d20aeb9347f3d4465 Reviewed-by: Eike Ziller Reviewed-by: Erik Verbruggen --- src/plugins/qmljstools/qmljsmodelmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index 5eb2308368..c3092bf1cb 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -148,7 +148,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject( projectInfo.tryQmlDump = project && qtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT); projectInfo.qtQmlPath = qtVersion->qmlPath().toFileInfo().canonicalFilePath(); projectInfo.qtVersionString = qtVersion->qtVersionString(); - } else if (!activeKit->value(QtSupport::SuppliesQtQuickImportPath::id(), false).toBool()) { + } else if (!activeKit || !activeKit->value(QtSupport::SuppliesQtQuickImportPath::id(), false).toBool()) { projectInfo.qtQmlPath = QFileInfo(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)).canonicalFilePath(); projectInfo.qtVersionString = QLatin1String(qVersion()); } -- cgit v1.2.3