From b47d41c2f0da1e81aa2aba361193e9cc96fed4d7 Mon Sep 17 00:00:00 2001
From: dt <qtc-committer@nokia.com>
Date: Wed, 28 Oct 2009 16:26:43 +0100
Subject: [PATCH] Fix crash with no toolchain.

---
 src/plugins/qt4projectmanager/makestep.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp
index 13f9d7c1e0f..bdb1bc4cc9c 100644
--- a/src/plugins/qt4projectmanager/makestep.cpp
+++ b/src/plugins/qt4projectmanager/makestep.cpp
@@ -106,10 +106,10 @@ bool MakeStep::init(const QString &name)
     // but for now this is the least invasive change
     ProjectExplorer::ToolChain *toolchain = qt4project->toolChain(bc);
 
-    ProjectExplorer::ToolChain::ToolChainType t =  ProjectExplorer::ToolChain::UNKNOWN;
+    ProjectExplorer::ToolChain::ToolChainType type =  ProjectExplorer::ToolChain::UNKNOWN;
     if (toolchain)
-        t = toolchain->type();
-    if (t != ProjectExplorer::ToolChain::MSVC && t != ProjectExplorer::ToolChain::WINCE) {
+        type = toolchain->type();
+    if (type != ProjectExplorer::ToolChain::MSVC && type != ProjectExplorer::ToolChain::WINCE) {
         if (value(name, "makeCmd").toString().isEmpty())
             args << "-w";
     }
@@ -117,8 +117,7 @@ bool MakeStep::init(const QString &name)
     setEnabled(name, true);
     setArguments(name, args);
 
-    ProjectExplorer::ToolChain::ToolChainType type = qt4project->toolChain(bc)->type();
-    if ( type == ProjectExplorer::ToolChain::MSVC || type == ProjectExplorer::ToolChain::WINCE)
+    if (type == ProjectExplorer::ToolChain::MSVC || type == ProjectExplorer::ToolChain::WINCE)
         setBuildParser(ProjectExplorer::Constants::BUILD_PARSER_MSVC);
     else
         setBuildParser(ProjectExplorer::Constants::BUILD_PARSER_GCC);
-- 
GitLab