Commit b53d6cbc authored by Lorenz Meier's avatar Lorenz Meier

Protect against empty lists

parent d55bf995
...@@ -435,17 +435,21 @@ void WaypointList::currentWaypointViewOnlyChanged(quint16 seq) ...@@ -435,17 +435,21 @@ void WaypointList::currentWaypointViewOnlyChanged(quint16 seq)
void WaypointList::updateWaypointEditable(int uas, Waypoint* wp) void WaypointList::updateWaypointEditable(int uas, Waypoint* wp)
{ {
Q_UNUSED(uas); Q_UNUSED(uas);
WaypointEditableView *wpv = wpEditableViews.value(wp); WaypointEditableView *wpv = wpEditableViews.value(wp, NULL);
wpv->updateValues(); if (wpv) {
m_ui->tabWidget->setCurrentIndex(0); // XXX magic number wpv->updateValues();
}
m_ui->tabWidget->setCurrentIndex(0); // XXX magic number
} }
void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp) void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp)
{ {
Q_UNUSED(uas); Q_UNUSED(uas);
WaypointViewOnlyView *wpv = wpViewOnlyViews.value(wp); WaypointViewOnlyView *wpv = wpViewOnlyViews.value(wp, NULL);
wpv->updateValues(); if (wpv) {
m_ui->tabWidget->setCurrentIndex(1); // XXX magic number wpv->updateValues();
}
m_ui->tabWidget->setCurrentIndex(1); // XXX magic number
} }
void WaypointList::waypointViewOnlyListChanged() void WaypointList::waypointViewOnlyListChanged()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment