ProjectExplorer: Consider the case of no active target

... in BuildManager.

Fixes: QTCREATORBUG-29207
Change-Id: Icbcdc957cd9105f7c4b9bc27fc9feb34dd547955
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Christian Kandeler
2023-05-30 16:18:06 +02:00
parent a6fd8d2f60
commit 7a37a9c76c

View File

@@ -61,7 +61,9 @@ static const QList<Target *> targetsForSelection(const Project *project,
{ {
if (targetSelection == ConfigSelection::All) if (targetSelection == ConfigSelection::All)
return project->targets(); return project->targets();
if (project->activeTarget())
return {project->activeTarget()}; return {project->activeTarget()};
return {};
} }
static const QList<BuildConfiguration *> buildConfigsForSelection(const Target *target, static const QList<BuildConfiguration *> buildConfigsForSelection(const Target *target,