Permalink
Browse files

guard in boolean filter from null doc id sets and iterators

  • Loading branch information...
1 parent 3894472 commit 7cccacbcfaeab9cdf16229b7c72469c4efcf72f9 @kimchy kimchy committed May 6, 2011
@@ -41,7 +41,15 @@
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() {

0 comments on commit 7cccacb

Please sign in to comment.