public IfStatement(String variable, TemplateBlock body) {
this.variable = variable;
this.iftrue = body;
- iffalse = null;
+ this.iffalse = null;
}
public IfStatement(String variable, TemplateBlock iftrue, TemplateBlock iffalse) {
@Override
public void output(PrintWriter out, Language l, Map<String, Object> vars) {
Object o = vars.get(variable);
- if ( !(o == Boolean.FALSE || o == null)) {
+
+ if ( !(o == null || Boolean.FALSE.equals(o))) {
iftrue.output(out, l, vars);
} else if (iffalse != null) {
iffalse.output(out, l, vars);
}
}
+
}