GPS: make 'loadRouteWaypoint' robust about bad scratch/index values.
This commit is contained in:
parent
52905875f9
commit
053d405a5c
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue