fix rarely occurring bug: if the node isn't initialized, then cap is nil
and can't be compared with a scalar, but only with nil itself
This commit is contained in:
parent
bb8b06e294
commit
af04d04e79
1 changed files with 2 additions and 2 deletions
|
@ -422,7 +422,7 @@ showWeightDialog = func {
|
|||
cap = t.getNode("capacity-gal_us", 1).getValue();
|
||||
|
||||
# Hack, to ignore the "ghost" tanks created by the C++ code.
|
||||
if(cap < 1) { continue; }
|
||||
if(cap == nil or cap < 1) { continue; }
|
||||
|
||||
title = tcell(fuelTable, "text", i+1, 0);
|
||||
title.set("label", tname);
|
||||
|
@ -546,7 +546,7 @@ showHelpDialog = func {
|
|||
return;
|
||||
}
|
||||
|
||||
dialog[name] = gui.Widget.new();
|
||||
dialog[name] = Widget.new();
|
||||
dialog[name].set("layout", "vbox");
|
||||
dialog[name].set("default-padding", 0);
|
||||
dialog[name].set("name", name);
|
||||
|
|
Loading…
Reference in a new issue