From 113723bb0e5045d6551913b06646e95790d7ffbb Mon Sep 17 00:00:00 2001
From: dt <qtc-committer@nokia.com>
Date: Thu, 12 Feb 2009 12:39:19 +0100
Subject: [PATCH] Fixes:    Don't crash if we don't get any toolchain.

Details:  Stupid me.
---
 src/plugins/qt4projectmanager/qt4project.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp
index 6a27c484b80..05be102b81c 100644
--- a/src/plugins/qt4projectmanager/qt4project.cpp
+++ b/src/plugins/qt4projectmanager/qt4project.cpp
@@ -457,8 +457,12 @@ void Qt4Project::updateCodeModel()
     const QString newQtLibsPath = versionInfo.value(QLatin1String("QT_INSTALL_LIBS"));
 
     ToolChain *tc = toolChain(activeBuildConfiguration());
-    QByteArray predefinedMacros = tc->predefinedMacros();
-    QList<HeaderPath> allHeaderPaths = tc->systemHeaderPaths();
+    QByteArray predefinedMacros;
+    QList<HeaderPath> allHeaderPaths;
+    if (tc) {
+        predefinedMacros = tc->predefinedMacros();
+        allHeaderPaths = tc->systemHeaderPaths();
+    }
     foreach (HeaderPath headerPath, allHeaderPaths) {
         if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
             allFrameworkPaths.append(headerPath.path());
-- 
GitLab