diff --git a/lucene/src/java/org/apache/lucene/index/DirectoryReader.java b/lucene/src/java/org/apache/lucene/index/DirectoryReader.java index fe64a210aee..1dbfa2b2767 100644 --- a/lucene/src/java/org/apache/lucene/index/DirectoryReader.java +++ b/lucene/src/java/org/apache/lucene/index/DirectoryReader.java @@ -433,7 +433,7 @@ class DirectoryReader extends IndexReader implements Cloneable { IndexReader reader = writer.getReader(applyAllDeletes); // If in fact no changes took place, return null: - if (reader.getVersion() == getVersion()) { + if (reader.getVersion() == segmentInfos.getVersion()) { reader.decRef(); return null; }