From a10274665dc5eb8828c541dfd025ef2e6a718a9a Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Mon, 22 Jul 2019 15:02:18 +0100 Subject: [PATCH] Nasal/view.nas: pilot_view_limiter: protect against nil. --- Nasal/view.nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nasal/view.nas b/Nasal/view.nas index 3a3628f66..0575ee420 100644 --- a/Nasal/view.nas +++ b/Nasal/view.nas @@ -581,7 +581,7 @@ var pilot_view_limiter = { offset = (me.right.threshold - hdg) * me.right.scale; var new_offset = me.xoffset_lowpass.filter(offset); - me.xoffsetN.setDoubleValue(me.xoffsetN.getValue() - me.last_offset + new_offset); + me.xoffsetN.setDoubleValue((me.xoffsetN.getValue() or 0) - me.last_offset + new_offset); me.last_offset = new_offset; } return 0;