Route-manager: guard against a procedure failure
When we have a STAR which is invalid for the selected runway, which can occur when switching runway/approach, don’t cause a Nasal runtime error.
This commit is contained in:
parent
52373760e2
commit
20bcc16032
1 changed files with 4 additions and 4 deletions
|
@ -42,7 +42,6 @@ var RouteManagerDelegate = {
|
|||
|
||||
arrivalChanged: func
|
||||
{
|
||||
printlog('info', 'saw arrival changed');
|
||||
me.flightplan.clearWPType('star');
|
||||
me.flightplan.clearWPType('approach');
|
||||
if (me.flightplan.destination == nil)
|
||||
|
@ -60,9 +59,10 @@ var RouteManagerDelegate = {
|
|||
if (me.flightplan.star != nil) {
|
||||
printlog('info', 'routing via STAR ' ~ me.flightplan.star.id);
|
||||
var wps = me.flightplan.star.route(me.flightplan.destination_runway);
|
||||
me.flightplan.insertWaypoints(wps, -1);
|
||||
|
||||
initialApproachFix = wps[-1]; # final waypoint of STAR
|
||||
if (wps != nil) {
|
||||
me.flightplan.insertWaypoints(wps, -1);
|
||||
initialApproachFix = wps[-1]; # final waypoint of STAR
|
||||
}
|
||||
}
|
||||
|
||||
if (me.flightplan.approach != nil) {
|
||||
|
|
Loading…
Add table
Reference in a new issue