Skip to content

Commit af1ee12

Browse files
authored
Merge pull request #1096 from npharate/indexOutOfBounds
fix IndexOutOfBoundsException
2 parents dbe407b + c80b546 commit af1ee12

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/hubspot/jinjava/lib/tag/eager/EagerForTag.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ public String innerInterpret(TagNode tagNode, JinjavaInterpreter interpreter) {
6464
tagNode,
6565
eagerInterpreter,
6666
loopVarsAndExpression.getLeft(),
67-
collectionResult.getResult().toList().get(0)
67+
!collectionResult.getResult().toList().isEmpty()
68+
? collectionResult.getResult().toList().get(0)
69+
: Collections.emptyList()
6870
),
6971
eagerInterpreter
7072
);

0 commit comments

Comments
 (0)