LUCENE-3588: Missed NPE -> AlreadyClosedException in getFilePointer

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1205954 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2011-11-24 18:39:44 +00:00
parent 6bdb9f9f06
commit 8d7ed3549a
1 changed files with 5 additions and 1 deletions

View File

@ -372,7 +372,11 @@ public class MMapDirectory extends FSDirectory {
@Override
public long getFilePointer() {
return (((long) curBufIndex) << chunkSizePower) + curBuf.position();
try {
return (((long) curBufIndex) << chunkSizePower) + curBuf.position();
} catch (NullPointerException npe) {
throw new AlreadyClosedException("MMapIndexInput already closed: " + this);
}
}
@Override