Fixed a NullPointerException in ifs without an else.

The NPE occured if the condition was not optimizable to a constant.
This commit is contained in:
TomyLobo 2012-07-13 12:16:15 +02:00
parent 9f2f2fc6c9
commit fd4e94220f

View File

@ -74,6 +74,6 @@ public class Conditional extends Node {
}
}
return new Conditional(getPosition(), newCondition, truePart.optimize(), falsePart.optimize());
return new Conditional(getPosition(), newCondition, truePart.optimize(), falsePart == null ? null : falsePart.optimize());
}
}