mirror of https://github.com/apache/lucene.git
LUCENE-10629: Fix NullPointerException.
I hit a NPE while running tests. `Weight#scorer` may return `null`, but not `Scorer#iterator`.
This commit is contained in:
parent
7ac75135b9
commit
04e4f317cb
|
@ -73,11 +73,11 @@ public abstract class FacetCountsWithFilterQuery extends Facets {
|
|||
final Weight fastMatchWeight =
|
||||
searcher.createWeight(searcher.rewrite(fastMatchQuery), ScoreMode.COMPLETE_NO_SCORES, 1);
|
||||
final Scorer s = fastMatchWeight.scorer(hits.context);
|
||||
DocIdSetIterator fastMatchQueryIterator = s.iterator();
|
||||
if (fastMatchQueryIterator == null) {
|
||||
if (s == null) {
|
||||
// no matching docs by the fast match query
|
||||
return null;
|
||||
} else {
|
||||
DocIdSetIterator fastMatchQueryIterator = s.iterator();
|
||||
allIterators.add(fastMatchQueryIterator);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue