From 71855e6bbca7c668443753481109606557412363 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Mon, 16 Mar 2015 19:12:27 +0100 Subject: [PATCH] Fix crash with kits that have no toolchain Change-Id: I3f041b9a7fe60ab5adf4ab3054f53713b78e1ab6 Task-number: QTCREATORBUG-14150 Reviewed-by: Robert Loehning --- src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index 762323c4e14..b2d660d596f 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -191,8 +191,12 @@ QList QmakeProjectImporter::import(const FileName &importPath, bool ToolChain *tc = ToolChainKitInformation::toolChain(k); if (kitSpec.isEmpty() && kitVersion) kitSpec = kitVersion->mkspecFor(tc); - QMakeStepConfig::TargetArchConfig kitTargetArch = QMakeStepConfig::targetArchFor(tc->targetAbi(), kitVersion); - QMakeStepConfig::OsType kitOsType = QMakeStepConfig::osTypeFor(tc->targetAbi(), kitVersion); + QMakeStepConfig::TargetArchConfig kitTargetArch = QMakeStepConfig::NoArch; + QMakeStepConfig::OsType kitOsType = QMakeStepConfig::NoOsType; + if (tc) { + kitTargetArch = QMakeStepConfig::targetArchFor(tc->targetAbi(), kitVersion); + kitOsType = QMakeStepConfig::osTypeFor(tc->targetAbi(), kitVersion); + } qCDebug(logs) << k->displayName() << "version:" << (kitVersion == version) << "spec:" << (kitSpec == parsedSpec)