Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-14290: Fix NPE by external users of SolrTestCaseJ4 (#739)

David Smiley6ad42676d3a7
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index 0c3d47cad57..6c11cc72e8b 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -283,7 +283,9 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {
true);
// set solr.install.dir needed by some test configs outside of the test sandbox (!)
- System.setProperty("solr.install.dir", ExternalPaths.SOURCE_HOME);
+ if (ExternalPaths.SOURCE_HOME != null) {
+ System.setProperty("solr.install.dir", ExternalPaths.SOURCE_HOME);
+ }
// not strictly needed by this class at this point in the control lifecycle, but for
// backcompat create it now in case any third party tests expect initCoreDataDir to be
// non-null after calling setupTestCases()