From f6ab135517d9c45b711d732bc02f107c2ee8ca1e Mon Sep 17 00:00:00 2001 From: dt Date: Thu, 3 Sep 2009 17:45:55 +0200 Subject: [PATCH] Fix potential crash. (cherry picked from commit 778db1bf2df839b9cbe969333d22a65083ab74f6) --- src/plugins/qt4projectmanager/makestep.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp index e22eea26d68..acc1db3a8fc 100644 --- a/src/plugins/qt4projectmanager/makestep.cpp +++ b/src/plugins/qt4projectmanager/makestep.cpp @@ -220,7 +220,10 @@ void MakeStepConfigWidget::updateDetails() // so we only do it for unix and if the user didn't override the make command // but for now this is the least invasive change QStringList args = m_makeStep->value(m_buildConfiguration, "makeargs").toStringList(); - ProjectExplorer::ToolChain::ToolChainType t = qobject_cast(pro)->toolChain(m_buildConfiguration)->type(); + ProjectExplorer::ToolChain::ToolChainType t = ProjectExplorer::ToolChain::UNKNOWN; + ProjectExplorer::ToolChain *toolChain = qobject_cast(pro)->toolChain(m_buildConfiguration); + if (toolChain) + t = toolChain->type(); if (t != ProjectExplorer::ToolChain::MSVC && t != ProjectExplorer::ToolChain::WINCE) { if (m_makeStep->value(m_buildConfiguration, "makeCmd").toString().isEmpty()) args << "-w";