1
0
Fork 0

GPS: make 'loadRouteWaypoint' robust about bad scratch/index values.

This commit is contained in:
jmt 2009-12-20 22:19:32 +00:00 committed by Tim Moore
parent 52905875f9
commit 053d405a5c

View file

@ -1381,7 +1381,7 @@ void GPS::loadRouteWaypoint()
int index = _scratchNode->getIntValue("index", -9999);
clearScratch();
if (index == -9999) { // no index supplied, use current wp
if ((index < 0) || (index >= _routeMgr->size())) { // no index supplied, use current wp
index = _routeMgr->currentWaypoint();
}