mirror of https://github.com/apache/lucene.git
SOLR-6530: Protect against NPE when there are no live replicas
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1633276 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c1bdf27d97
commit
58fe66dba7
|
@ -850,10 +850,12 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
|
|||
List<ZkCoreNodeProps> myReplicas = zkController.getZkStateReader().getReplicaProps(collection,
|
||||
cloudDesc.getShardId(), cloudDesc.getCoreNodeName());
|
||||
boolean foundErrorNodeInReplicaList = false;
|
||||
for (ZkCoreNodeProps replicaProp : myReplicas) {
|
||||
if (((Replica) replicaProp.getNodeProps()).getName().equals(((Replica)stdNode.getNodeProps().getNodeProps()).getName())) {
|
||||
foundErrorNodeInReplicaList = true;
|
||||
break;
|
||||
if (myReplicas != null) {
|
||||
for (ZkCoreNodeProps replicaProp : myReplicas) {
|
||||
if (((Replica) replicaProp.getNodeProps()).getName().equals(((Replica)stdNode.getNodeProps().getNodeProps()).getName())) {
|
||||
foundErrorNodeInReplicaList = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue