guard in boolean filter from null doc id sets and iterators
This commit is contained in:
parent
3894472f49
commit
7cccacbcfa
|
@ -41,7 +41,15 @@ public class XBooleanFilter extends Filter {
|
|||
|
||||
private DocIdSetIterator getDISI(ArrayList<Filter> filters, int index, IndexReader reader)
|
||||
throws IOException {
|
||||
return filters.get(index).getDocIdSet(reader).iterator();
|
||||
DocIdSet docIdSet = filters.get(index).getDocIdSet(reader);
|
||||
if (docIdSet == null) {
|
||||
return DocIdSet.EMPTY_DOCIDSET.iterator();
|
||||
}
|
||||
DocIdSetIterator iterator = docIdSet.iterator();
|
||||
if (iterator == null) {
|
||||
return DocIdSet.EMPTY_DOCIDSET.iterator();
|
||||
}
|
||||
return iterator;
|
||||
}
|
||||
|
||||
public List<Filter> getShouldFilters() {
|
||||
|
|
Loading…
Reference in New Issue