diff --git a/Nasal/controls.nas b/Nasal/controls.nas index 6d2bc6e73..6e2f73ad4 100644 --- a/Nasal/controls.nas +++ b/Nasal/controls.nas @@ -391,7 +391,7 @@ var ptt = func(b) setprop("/instrumentation/comm/ptt", b); ## # Lighting # -var toggleLights = func () { +var toggleLights = func { if (getprop("/controls/switches/panel-lights")) { setprop("/controls/switches/panel-lights-factor", 0); setprop("/controls/switches/panel-lights", 0); diff --git a/Nasal/globals.nas b/Nasal/globals.nas index 826c40706..47e3bf296 100644 --- a/Nasal/globals.nas +++ b/Nasal/globals.nas @@ -71,7 +71,7 @@ var interpolate = func(node, val...) { # "always trigger on write" (1), and "trigger even when children are # written to" (2). # -var setlistener = func(node, fun, init=0, runtime=1) { +var setlistener = func(node, fun, init = 0, runtime = 1) { if(isa(node, props.Node)) node = node._g; var id = _setlistener(node, func { arg[0] = props.wrapNode(arg[0]); diff --git a/Nasal/prop-key-handler.nas b/Nasal/prop-key-handler.nas index fc295c776..8a245a31e 100644 --- a/Nasal/prop-key-handler.nas +++ b/Nasal/prop-key-handler.nas @@ -125,7 +125,7 @@ var handle_key = func(key, shift) { input = complete(explicit_input, shift ? -1 : 1); build_completion(explicit_input); var n = call(func { props.globals.getNode(input) }, [], var err = []); - if (!size(err) and n.getAttribute("children") and size(completion) == 1) + if (!size(err) and n != nil and n.getAttribute("children") and size(completion) == 1) handle_key(`/`, 0); } diff --git a/Nasal/tutorial.nas b/Nasal/tutorial.nas index 0077b9589..5d89e0b8f 100644 --- a/Nasal/tutorial.nas +++ b/Nasal/tutorial.nas @@ -84,7 +84,7 @@ var startTutorial = func { var presets = tutorialN.getChild("presets"); if (presets != nil) { props.copy(presets, props.globals.getNode("/sim/presets")); - fgcommand("presets-commit", props.Node.new()); + fgcommand("presets-commit"); if (getprop("/sim/presets/on-ground")) { var eng = props.globals.getNode("/controls/engines");