diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 25d4d1196bd..e95246e7131 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -622,12 +622,8 @@ RunConfiguration *dummyRunConfigForKit(ProjectExplorer::Kit *kit) { QTC_ASSERT(kit, return nullptr); // Caller needs to look for a suitable kit. Project *project = SessionManager::startupProject(); - Target *target = nullptr; - if (project) { - target = project->target(kit); - if (!target) - target = project->createTarget(kit); - } else { + Target *target = project ? project->target(kit) : nullptr; + if (!target) { project = new DummyProject; target = project->createTarget(kit); }