From 45f15f0eedd6f19c6651783a9a462bf697a77973 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Thu, 22 Jul 2010 16:23:14 +0200
Subject: [PATCH] debugger: handle switching to "no project" gracefully.

---
 src/plugins/debugger/debuggerplugin.cpp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 565c6bfb527..0915fe45c43 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1643,11 +1643,13 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
 
 void DebuggerPluginPrivate::onCurrentProjectChanged(ProjectExplorer::Project *project)
 {
-    QTC_ASSERT(project, return);
-    ProjectExplorer::Target *target = project->activeTarget();
-    QTC_ASSERT(target, return);
-    ProjectExplorer::RunConfiguration *activeRc = target->activeRunConfiguration();
-    QTC_ASSERT(activeRc, return);
+    ProjectExplorer::RunConfiguration *activeRc = 0;
+    if (project) {
+        ProjectExplorer::Target *target = project->activeTarget();
+        QTC_ASSERT(target, return);
+        activeRc = target->activeRunConfiguration();
+        QTC_ASSERT(activeRc, /**/);
+    }
     for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) {
         DebuggerRunControl *runControl = m_snapshotHandler->at(i);
         RunConfiguration *rc = runControl->runConfiguration();
-- 
GitLab