UiCodeModelSupport: Fix crash when removing kit

Change-Id: I30c5c9f2456e911d01376b1c06f2255a95080897
Task-number: QTCREATORBUG-15120
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Robert Loehning
2015-09-30 15:38:30 +02:00
parent 7740c31746
commit 47654d6d73

View File

@@ -251,12 +251,12 @@ void UiCodeModelSupport::updateFromBuild()
QString UiCodeModelSupport::uicCommand() const
{
QtSupport::BaseQtVersion *version;
if (m_project->needsConfiguration()) {
version = QtSupport::QtKitInformation::qtVersion(ProjectExplorer::KitManager::defaultKit());
} else {
ProjectExplorer::Target *target = m_project->activeTarget();
ProjectExplorer::Target *target;
if (!m_project->needsConfiguration()
&& (target = m_project->activeTarget()))
version = QtSupport::QtKitInformation::qtVersion(target->kit());
}
else
version = QtSupport::QtKitInformation::qtVersion(ProjectExplorer::KitManager::defaultKit());
return version ? version->uicCommand() : QString();
}