Avoid returning a default SDK for a platform with no SDKs.

This would crash if a platform name matched, but it had no SDKs.
This commit is contained in:
Grant Paul 2016-11-18 01:52:45 -08:00 committed by Grant Paul
parent b55e87094e
commit f609fb944d

View File

@ -47,9 +47,11 @@ findTarget(std::string const &name) const
/* If the platform name matches but no targets do, use any target. */
if (platform->name() == name || platform->path() == name) {
if (!platform->targets().empty()) {
return platform->targets().back();
}
}
}
return nullptr;
}