diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index 4cf4b6994f641d740ce3d3bf063e93338c2d5115..fddc4b91519ecae4df97700fd064fe68a7e72fda 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -435,17 +435,21 @@ void WaypointList::currentWaypointViewOnlyChanged(quint16 seq) void WaypointList::updateWaypointEditable(int uas, Waypoint* wp) { Q_UNUSED(uas); - WaypointEditableView *wpv = wpEditableViews.value(wp); - wpv->updateValues(); - m_ui->tabWidget->setCurrentIndex(0); // XXX magic number + WaypointEditableView *wpv = wpEditableViews.value(wp, NULL); + if (wpv) { + wpv->updateValues(); + } + m_ui->tabWidget->setCurrentIndex(0); // XXX magic number } void WaypointList::updateWaypointViewOnly(int uas, Waypoint* wp) { Q_UNUSED(uas); - WaypointViewOnlyView *wpv = wpViewOnlyViews.value(wp); - wpv->updateValues(); - m_ui->tabWidget->setCurrentIndex(1); // XXX magic number + WaypointViewOnlyView *wpv = wpViewOnlyViews.value(wp, NULL); + if (wpv) { + wpv->updateValues(); + } + m_ui->tabWidget->setCurrentIndex(1); // XXX magic number } void WaypointList::waypointViewOnlyListChanged()