Permalink
Browse files

fix NPEs, possible bugs somewhere

  • Loading branch information...
1 parent c6e55f2 commit abe1f8b38783041b48df94f4bdd9f3bfa8c5e59f @sguo sguo committed Dec 3, 2011
View
2 src/main/java/com/kamikaze/docidset/impl/AndDocIdSet.java
@@ -59,6 +59,8 @@ public AndDocIdSet(List<DocIdSet> docSets) {
for (DocIdSet set : sets) {
if (set != null) {
DocIdSetIterator dcit = set.iterator();
+ if(dcit == null)
+ dcit = DocIdSet.EMPTY_DOCIDSET.iterator();
iterators[j++] = dcit;
}
}
View
2 src/main/java/com/kamikaze/docidset/impl/OrDocIdSetIterator.java
@@ -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;
}

0 comments on commit abe1f8b

Please sign in to comment.