Skip to content

Commit f696e06

Browse files
committed
Fix uncaught Error in ifelse()
Fix Java Error being thrown for `ifelse()` without arguments.
1 parent 49a0655 commit f696e06

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/laytonsmith/core/functions/ControlFlow.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ public ExampleScript[] examples() throws ConfigCompileException {
488488
@Override
489489
public List<Boolean> isBranch(List<ParseTree> children) {
490490
List<Boolean> branches = new ArrayList<>(children.size());
491+
if(children.size() == 0) {
492+
return branches;
493+
}
491494
// Only the first child is not a branch. Everything else is a branch.
492495
branches.add(false);
493496
for(int i = 1; i < children.size(); i++) {

0 commit comments

Comments
 (0)