diff --git a/src/java/org/apache/lucene/index/IndexModifier.java b/src/java/org/apache/lucene/index/IndexModifier.java index d5ab07f02f7..9e2750c2ec7 100644 --- a/src/java/org/apache/lucene/index/IndexModifier.java +++ b/src/java/org/apache/lucene/index/IndexModifier.java @@ -571,7 +571,7 @@ public class IndexModifier { if (indexWriter != null) { indexWriter.close(); indexWriter = null; - } else { + } else if (indexReader != null) { indexReader.close(); indexReader = null; }