Fix crash with kits that have no toolchain

Change-Id: I3f041b9a7fe60ab5adf4ab3054f53713b78e1ab6
Task-number: QTCREATORBUG-14150
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
This commit is contained in:
Daniel Teske
2015-03-16 19:12:27 +01:00
parent ddac471a8e
commit 71855e6bbc

View File

@@ -191,8 +191,12 @@ QList<BuildInfo *> 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)