1
0
Fork 0

Don't crash when tank property doesn't (yet) exist.

This commit is contained in:
ThorstenB 2011-09-25 16:20:04 +02:00
parent 8566fd61d6
commit 5392614331

View file

@ -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);
}