You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ds...@apache.org on 2022/03/10 20:12:03 UTC

[solr] branch branch_9x updated: SOLR-14290: Fix NPE by external users of SolrTestCaseJ4 (#739)

This is an automated email from the ASF dual-hosted git repository.

dsmiley pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 6b66081  SOLR-14290: Fix NPE by external users of SolrTestCaseJ4 (#739)
6b66081 is described below

commit 6b6608186bf5dbee9ec1cdbe3bec8d3043ae2001
Author: David Smiley <ds...@salesforce.com>
AuthorDate: Thu Mar 10 15:09:47 2022 -0500

    SOLR-14290: Fix NPE by external users of SolrTestCaseJ4 (#739)
---
 solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 0c3d47c..6c11cc7 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()