SOLR-10855: Null pointer exceptions in CartesianProductStream toExpression and explain methods

This commit is contained in:
Joel Bernstein 2017-06-08 20:55:20 -04:00
parent df74c65503
commit 463907a13c
1 changed files with 8 additions and 4 deletions

View File

@ -150,8 +150,10 @@ public class CartesianProductStream extends TupleStream implements Expressible {
for(NamedEvaluator evaluator : evaluators) {
expression.addParameter(String.format(Locale.ROOT, "%s as %s", evaluator.getEvaluator().toExpression(factory), evaluator.getName()));
}
expression.addParameter(new StreamExpressionNamedParameter("productSort", orderBy.toExpression(factory)));
if(orderBy != null) {
expression.addParameter(new StreamExpressionNamedParameter("productSort", orderBy.toExpression(factory)));
}
return expression;
}
@ -171,8 +173,10 @@ public class CartesianProductStream extends TupleStream implements Expressible {
for(NamedEvaluator evaluator : evaluators){
explanation.addHelper(evaluator.getEvaluator().toExplanation(factory));
}
explanation.addHelper(orderBy.toExplanation(factory));
if(orderBy != null) {
explanation.addHelper(orderBy.toExplanation(factory));
}
return explanation;
}