From 53926143313dabc832339b56bb364f49e9d8cd0c Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 25 Sep 2011 16:20:04 +0200 Subject: [PATCH] Don't crash when tank property doesn't (yet) exist. --- Nasal/fuel.nas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nasal/fuel.nas b/Nasal/fuel.nas index e4a26ae07..17f554a47 100644 --- a/Nasal/fuel.nas +++ b/Nasal/fuel.nas @@ -27,8 +27,8 @@ var update = func { var selected_tanks = []; foreach (var t; tanks) { - var cap = t.getNode("capacity-gal_us",0).getValue(); - if (cap > 0.01 and t.getNode("selected").getBoolValue()) + var cap = t.getNode("capacity-gal_us",0); + if ((cap!=nil) and (cap.getValue() > 0.01) and t.getNode("selected").getBoolValue()) append(selected_tanks, t); }