Fix an edge case in flight-plan inserts.
When inserting with an invalid index, ensure we return the leg based on the fixed-up index, not the original one. Thanks to Matthias Götz for the catch!
This commit is contained in:
parent
08e72f8bfc
commit
20071b66af
1 changed files with 1 additions and 1 deletions
|
@ -148,7 +148,7 @@ FlightPlan::Leg* FlightPlan::insertWayptAtIndex(Waypt* aWpt, int aIndex)
|
|||
}
|
||||
|
||||
insertWayptsAtIndex(wps, index);
|
||||
return legAtIndex(aIndex);
|
||||
return legAtIndex(index);
|
||||
}
|
||||
|
||||
void FlightPlan::insertWayptsAtIndex(const WayptVec& wps, int aIndex)
|
||||
|
|
Loading…
Add table
Reference in a new issue