guard in boolean filter from null doc id sets and iterators

This commit is contained in:
kimchy 2011-05-06 23:10:21 +03:00
parent 3894472f49
commit 7cccacbcfa
1 changed files with 9 additions and 1 deletions

View File

@ -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() {