QmlJSTools: Guard against null pointer access

Fixes: QTCREATORBUG-25943
Change-Id: If9e6528b0dc5642dbd150e7d20aeb9347f3d4465
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
This commit is contained in:
Robert Löhning
2021-07-06 14:04:33 +02:00
committed by Eike Ziller
parent 916fc90b44
commit e065107fa5

View File

@@ -148,7 +148,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
projectInfo.tryQmlDump = project && qtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT); projectInfo.tryQmlDump = project && qtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT);
projectInfo.qtQmlPath = qtVersion->qmlPath().toFileInfo().canonicalFilePath(); projectInfo.qtQmlPath = qtVersion->qmlPath().toFileInfo().canonicalFilePath();
projectInfo.qtVersionString = qtVersion->qtVersionString(); 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.qtQmlPath = QFileInfo(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)).canonicalFilePath();
projectInfo.qtVersionString = QLatin1String(qVersion()); projectInfo.qtVersionString = QLatin1String(qVersion());
} }