1
0
Fork 0

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:
James Turner 2022-03-06 18:53:41 +00:00
parent 55641c3727
commit 54948c502c

View file

@ -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")) {