Skip to content

Apache Lucene open-source search software

ensure that a newly opened searcher has a non null newIndexDir to work from

Mark Robert Millerccee2bca8f4b
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java
index 3c4c6f53855..66afe42118b 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java
@@ -1053,14 +1053,13 @@ public final class SolrCore implements SolrInfoMBean {
openSearcherLock.lock();
try {
- String newIndexDir = null;
+ String newIndexDir = getNewIndexDir();
File indexDirFile = null;
File newIndexDirFile = null;
// if it's not a normal near-realtime update, check that paths haven't changed.
if (!nrt) {
indexDirFile = new File(getIndexDir()).getCanonicalFile();
- newIndexDir = getNewIndexDir();
newIndexDirFile = new File(newIndexDir).getCanonicalFile();
}