Skip to content

Commit

Permalink
Allow foreach to create a list directly in the context
Browse files Browse the repository at this point in the history
  • Loading branch information
arkanovicz committed Sep 9, 2021
1 parent b56a4cd commit b42af6e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ protected void handleForeachDirective(String source, Context context, ScrapeCont
}
if (value != null && value instanceof List && ((List) value).size() == 0) {
list = (List)value;
} else if (!(value instanceof Collection)) {
} else if (value != null && !(value instanceof Collection)) {
throw new ScrapeException("Cannot fill a non-list object in #foreach");
}

Expand Down

0 comments on commit b42af6e

Please sign in to comment.