Skip to content
Browse files

[bugfix] Fixed NPEs in upgraded lucene index.

svn path=/branches/rangeindex/; revision=18408
  • Loading branch information...
1 parent 9b8748a commit 4bd746a28b5ff4212ba09b7078d8b16d5774d38f @wolfgangmm wolfgangmm committed May 8, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java
View
4 extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java
@@ -744,7 +744,7 @@ public String getFieldContent(int docId, String field) throws IOException {
List<AtomicReaderContext> leaves = reader.leaves();
for (AtomicReaderContext context : leaves) {
DocsEnum docs = context.reader().termDocsEnum(dt);
- if (docs.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+ if (docs != null && docs.nextDoc() != DocsEnum.NO_MORE_DOCS) {
Document doc = reader.document(docs.docID());
return doc.get(field);
}
@@ -768,7 +768,7 @@ public boolean hasIndex(int docId) throws IOException {
List<AtomicReaderContext> leaves = reader.leaves();
for (AtomicReaderContext context : leaves) {
DocsEnum docs = context.reader().termDocsEnum(dt);
- if (docs.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+ if (docs != null && docs.nextDoc() != DocsEnum.NO_MORE_DOCS) {
found = true;
break;
}

0 comments on commit 4bd746a

Please sign in to comment.
Something went wrong with that request. Please try again.