protect object against NPE in finally block, as an NPE here would hide the original exception

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@558160 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2007-07-20 21:38:55 +00:00
parent 58027a24bb
commit 86432275f6
1 changed files with 3 additions and 1 deletions

View File

@ -2273,7 +2273,9 @@ public class IndexWriter {
}
} finally {
// close readers before we attempt to delete now-obsolete segments
merger.closeReaders();
if (merger != null) {
merger.closeReaders();
}
}
// Give deleter a chance to remove files now.