Location in air: Guard against missing carriers.
Since we don’t force node creation, tolerate the node being nil in the dialog Nasal helpers
This commit is contained in:
parent
55641c3727
commit
54948c502c
1 changed files with 6 additions and 0 deletions
|
@ -62,6 +62,9 @@
|
|||
var carriers = props.globals.getNode( "/ai/models" );
|
||||
|
||||
combo.removeChildren("value");
|
||||
if (carriers == nil)
|
||||
return;
|
||||
|
||||
foreach (var carrier; carriers.getChildren("carrier")) {
|
||||
nameNode = carrier.getNode("name");
|
||||
if(nameNode != nil and nameNode.getValue() != nil)
|
||||
|
@ -81,6 +84,9 @@
|
|||
combo.addChild("value").setValue("FLOLS");
|
||||
combo.addChild("value").setValue("Abeam");
|
||||
|
||||
if (carriers == nil)
|
||||
return;
|
||||
|
||||
foreach (var carrier; carriers.getChildren("carrier")) {
|
||||
if (carrier.getNode("name", 1).getValue() == getprop("/sim/presets/carrier")) {
|
||||
foreach (var parkpos; carrier.getChildren("parking-pos")) {
|
||||
|
|
Loading…
Reference in a new issue