Permalink
Browse files

Fix array out of bound error.

  • Loading branch information...
1 parent 9d9f7da commit 0e2f5c2ba46fd1157908cd019b72b12bd328170b @wonlay wonlay committed Dec 14, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 zoie-core/src/main/java/proj/zoie/api/ZoieMultiReader.java
@@ -67,8 +67,10 @@ public ZoieMultiReader(IndexReader in,IndexReader[] subReaders,IndexReaderDecora
@Override
public byte[] getStoredValue(long uid) throws IOException {
- int docid = this.getDocIDMaper().getDocID(uid);
- int idx = readerIndex(docid);
+ int docid = this.getDocIDMaper().getDocID(uid);
+ if (docid < 0) return null;
+ int idx = readerIndex(docid);
+ if (idx < 0) return null;
ZoieIndexReader<R> subReader = _subZoieReaders.get(idx);
return subReader.getStoredValue(uid);
}

0 comments on commit 0e2f5c2

Please sign in to comment.