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:
@@ -501,7 +501,8 @@ QString RunConfigurationFactory::decoratedTargetName(const QString &targetName,
|
|||||||
QList<RunConfigurationCreationInfo>
|
QList<RunConfigurationCreationInfo>
|
||||||
RunConfigurationFactory::availableCreators(Target *target) const
|
RunConfigurationFactory::availableCreators(Target *target) const
|
||||||
{
|
{
|
||||||
const QList<BuildTargetInfo> buildTargets = target->buildSystem()->applicationTargets();
|
auto *bs = target->buildSystem();
|
||||||
|
const auto buildTargets = bs ? bs->applicationTargets() : QList<BuildTargetInfo>{};
|
||||||
const bool hasAnyQtcRunnable = Utils::anyOf(buildTargets,
|
const bool hasAnyQtcRunnable = Utils::anyOf(buildTargets,
|
||||||
Utils::equal(&BuildTargetInfo::isQtcRunnable, true));
|
Utils::equal(&BuildTargetInfo::isQtcRunnable, true));
|
||||||
return Utils::transform(buildTargets, [&](const BuildTargetInfo &ti) {
|
return Utils::transform(buildTargets, [&](const BuildTargetInfo &ti) {
|
||||||
|
|||||||
@@ -169,7 +169,8 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
|
|||||||
// For an IDE things are a bit more complicated because source files might be edited,
|
// For an IDE things are a bit more complicated because source files might be edited,
|
||||||
// and the directory of the executable might be outdated.
|
// and the directory of the executable might be outdated.
|
||||||
// Here we try to get the directory of the executable, adding all targets
|
// 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) {
|
for (const auto &target : appTargets) {
|
||||||
if (target.targetFilePath.isEmpty())
|
if (target.targetFilePath.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user