Launcher: Fix a crash in the new location code
This commit is contained in:
parent
7d84a03dea
commit
ca785f01e5
1 changed files with 7 additions and 4 deletions
|
@ -779,10 +779,13 @@ QVariantMap LocationController::saveLocation() const
|
||||||
locationSet.insert("location-apt-final-distance", m_offsetNm);
|
locationSet.insert("location-apt-final-distance", m_offsetNm);
|
||||||
if (m_useActiveRunway) {
|
if (m_useActiveRunway) {
|
||||||
locationSet.insert("location-apt-runway", "ACTIVE");
|
locationSet.insert("location-apt-runway", "ACTIVE");
|
||||||
} else if (m_detailLocation->type() == FGPositioned::RUNWAY) {
|
} else if (m_detailLocation) {
|
||||||
locationSet.insert("location-apt-runway", QString::fromStdString(m_detailLocation->ident()));
|
const auto detailType = m_detailLocation->type();
|
||||||
} else if (m_detailLocation->type() == FGPositioned::PARKING) {
|
if (detailType == FGPositioned::RUNWAY) {
|
||||||
locationSet.insert("location-apt-parking", QString::fromStdString(m_detailLocation->ident()));
|
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 location is an airport
|
||||||
} // of m_location is valid
|
} // of m_location is valid
|
||||||
|
|
Loading…
Reference in a new issue