diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index ba0bfa221a3..930b7a6b3fa 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -186,6 +186,13 @@ BuildConfiguration *BuildStep::buildConfiguration() const auto config = qobject_cast(parent()->parent()); if (config) return config; + + // This situation should be avoided, as the step returned below is almost + // always not the right one, but the fallback is best we can do. + // A potential currently still valid path is accessing a build configuration + // from a BuildStep in a DeployConfiguration. Let's hunt those down and + // replace with explicit code there. + QTC_CHECK(false); // step is not part of a build configuration, use active build configuration of step's target return target()->activeBuildConfiguration(); } @@ -195,6 +202,8 @@ DeployConfiguration *BuildStep::deployConfiguration() const auto config = qobject_cast(parent()->parent()); if (config) return config; + // See comment in buildConfiguration() + QTC_CHECK(false); // step is not part of a deploy configuration, use active deploy configuration of step's target return target()->activeDeployConfiguration(); }