Soy: fix NPE when passing multiple expressions in {call data="..."}.
Soy has not supported multiple expressions in data attributes since at least mid-2015. (I'm not sure if ever did). But the check as currently written triggers an NPE before the error can be reported to the user.
@@ -247,7 +247,8 @@ public final class CommandTagAttribute {
if (valueExprList.size() > 1) {
reporter.report(
valueExprList.get(1).getSourceLocation(), EXPECTED_A_SINGLE_EXPRESSION, key.identifier());
- return null;
+ // Return the first expr to avoid an NPE in CallNode ctor.
+ return valueExprList.get(0);
}
return Iterables.getOnlyElement(valueExprList);
}
