1
0
Fork 0

Launcher: Fix a crash in the new location code

This commit is contained in:
James Turner 2018-06-25 16:40:00 +01:00
parent 7d84a03dea
commit ca785f01e5

View file

@ -779,10 +779,13 @@ QVariantMap LocationController::saveLocation() const
locationSet.insert("location-apt-final-distance", m_offsetNm);
if (m_useActiveRunway) {
locationSet.insert("location-apt-runway", "ACTIVE");
} else if (m_detailLocation->type() == FGPositioned::RUNWAY) {
locationSet.insert("location-apt-runway", QString::fromStdString(m_detailLocation->ident()));
} else if (m_detailLocation->type() == FGPositioned::PARKING) {
locationSet.insert("location-apt-parking", QString::fromStdString(m_detailLocation->ident()));
} else if (m_detailLocation) {
const auto detailType = m_detailLocation->type();
if (detailType == FGPositioned::RUNWAY) {
locationSet.insert("location-apt-runway", QString::fromStdString(m_detailLocation->ident()));
} else if (detailType == FGPositioned::PARKING) {
locationSet.insert("location-apt-parking", QString::fromStdString(m_detailLocation->ident()));
}
}
} // of location is an airport
} // of m_location is valid