Tweak permitted indices for GPS route insert commands.
This commit is contained in:
parent
2a86384da7
commit
08039f1fa5
1 changed files with 2 additions and 2 deletions
|
@ -1290,7 +1290,7 @@ void GPS::setCommand(const char* aCmd)
|
|||
defineWaypoint();
|
||||
} else if (!strcmp(aCmd, "route-insert-before")) {
|
||||
int index = _scratchNode->getIntValue("index");
|
||||
if (index < 0) {
|
||||
if (index < 0 || (_routeMgr->size() == 0)) {
|
||||
index = _routeMgr->size();
|
||||
} else if (index >= _routeMgr->size()) {
|
||||
SG_LOG(SG_INSTR, SG_WARN, "GPS:route-insert-before, bad index:" << index);
|
||||
|
@ -1300,7 +1300,7 @@ void GPS::setCommand(const char* aCmd)
|
|||
insertWaypointAtIndex(index);
|
||||
} else if (!strcmp(aCmd, "route-insert-after")) {
|
||||
int index = _scratchNode->getIntValue("index");
|
||||
if (index < 0) {
|
||||
if (index < 0 || (_routeMgr->size() == 0)) {
|
||||
index = _routeMgr->size();
|
||||
} else if (index >= _routeMgr->size()) {
|
||||
SG_LOG(SG_INSTR, SG_WARN, "GPS:route-insert-after, bad index:" << index);
|
||||
|
|
Loading…
Add table
Reference in a new issue