mirror of https://github.com/apache/lucene.git
avoid NullpointerException if close() method is called twice. See Bugzilla: #32403
Submitted by: Wolf Siberski Reviewed by: Bernhard Messer git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150686 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2b6b9f83d3
commit
adb32ee179
|
@ -338,8 +338,10 @@ public class IndexWriter {
|
|||
public synchronized void close() throws IOException {
|
||||
flushRamSegments();
|
||||
ramDirectory.close();
|
||||
writeLock.release(); // release write lock
|
||||
writeLock = null;
|
||||
if (writeLock != null) {
|
||||
writeLock.release(); // release write lock
|
||||
writeLock = null;
|
||||
}
|
||||
if(closeDir)
|
||||
directory.close();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue