Skip to content

Commit

Permalink
fix NPEs, possible bugs somewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
sguo committed Dec 3, 2011
1 parent c6e55f2 commit abe1f8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/com/kamikaze/docidset/impl/AndDocIdSet.java
Expand Up @@ -59,6 +59,8 @@ class AndDocIdSetIterator extends DocIdSetIterator {
for (DocIdSet set : sets) {
if (set != null) {
DocIdSetIterator dcit = set.iterator();
if(dcit == null)
dcit = DocIdSet.EMPTY_DOCIDSET.iterator();
iterators[j++] = dcit;
}
}
Expand Down
Expand Up @@ -29,7 +29,7 @@ public Item(DocIdSetIterator iter)
_size = 0;
for(DocIdSet set : sets)
{
_heap[_size++] = new Item(set.iterator());
_heap[_size++] = new Item(set.iterator()==null? DocIdSet.EMPTY_DOCIDSET.iterator() : set.iterator());
}
if(_size == 0) _curDoc = DocIdSetIterator.NO_MORE_DOCS;
}
Expand Down

0 comments on commit abe1f8b

Please sign in to comment.