lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctarg...@apache.org
Subject [36/50] [abbrv] lucene-solr:jira/solr-12746: SOLR-12877: avoid NPE in TestUtilizeNode.getReplicaList
Date Mon, 22 Oct 2018 23:35:21 GMT
SOLR-12877: avoid NPE in TestUtilizeNode.getReplicaList


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/2fbd4bd7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2fbd4bd7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2fbd4bd7

Branch: refs/heads/jira/solr-12746
Commit: 2fbd4bd70cd0c0f057364c94b6a3f01d52ce2444
Parents: 9f3a2ac
Author: Christine Poerschke <cpoerschke@apache.org>
Authored: Tue Oct 16 12:54:00 2018 -0400
Committer: Cassandra Targett <ctargett@apache.org>
Committed: Sun Oct 21 15:46:47 2018 -0500

----------------------------------------------------------------------
 .../src/test/org/apache/solr/cloud/TestUtilizeNode.java   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2fbd4bd7/solr/core/src/test/org/apache/solr/cloud/TestUtilizeNode.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestUtilizeNode.java b/solr/core/src/test/org/apache/solr/cloud/TestUtilizeNode.java
index bc64b6d..18ac662 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestUtilizeNode.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestUtilizeNode.java
@@ -170,11 +170,13 @@ public class TestUtilizeNode extends SolrCloudTestCase {
       .getClusterState().getCollectionOrNull(collectionName, false);
     
     List<Replica> results = new ArrayList<>(3);
-    collection.forEachReplica((s, replica) -> {
+    if (collection != null) {
+      collection.forEachReplica((s, replica) -> {
         if (replica.getNodeName().equals(jettyNode.getNodeName())) {
-        results.add(replica);
-      }
-    });
+          results.add(replica);
+        }
+      });
+    }
     return results;
   }
 


Mime
View raw message