Ensure TermInSetQuery ScoreSupplier never returns null Scorer

This commit is contained in:
Greg Miller 2022-09-01 15:31:14 -07:00
parent 680f21dca5
commit 202dd809bd
1 changed files with 3 additions and 5 deletions

View File

@ -386,12 +386,10 @@ public class TermInSetQuery extends Query implements Accountable {
@Override
public Scorer get(long leadCost) throws IOException {
WeightOrDocIdSet weightOrDocIdSet = rewrite(context);
if (weightOrDocIdSet == null) {
return null;
}
final Scorer scorer;
if (weightOrDocIdSet.weight != null) {
if (weightOrDocIdSet == null) {
scorer = null;
} else if (weightOrDocIdSet.weight != null) {
scorer = weightOrDocIdSet.weight.scorer(context);
} else {
scorer = scorer(weightOrDocIdSet.set);