forked from qt-creator/qt-creator
Fix crash when loading a .pyproject into Qt Creator with empty settings
The build system is 0 as long as no kits are created. Change-Id: Ia7f283071740dabe76ff3dd6b2f59e5ca214b7c2 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -169,7 +169,8 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
|
||||
// For an IDE things are a bit more complicated because source files might be edited,
|
||||
// and the directory of the executable might be outdated.
|
||||
// Here we try to get the directory of the executable, adding all targets
|
||||
const auto appTargets = activeTarget->buildSystem()->applicationTargets();
|
||||
auto *bs = activeTarget->buildSystem();
|
||||
const auto appTargets = bs ? bs->applicationTargets() : QList<BuildTargetInfo>{};
|
||||
for (const auto &target : appTargets) {
|
||||
if (target.targetFilePath.isEmpty())
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user