SOLR-12877: avoid NPE in TestUtilizeNode.getReplicaList

This commit is contained in:
Christine Poerschke 2018-10-16 12:54:00 -04:00
parent 15002eba2f
commit d2f7272b0e
1 changed files with 6 additions and 4 deletions

View File

@ -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;
}