lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r1633276 - /lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
Date Tue, 21 Oct 2014 06:10:18 GMT
Author: shalin
Date: Tue Oct 21 06:10:18 2014
New Revision: 1633276

URL: http://svn.apache.org/r1633276
Log:
SOLR-6530: Protect against NPE when there are no live replicas

Modified:
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java?rev=1633276&r1=1633275&r2=1633276&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
(original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
Tue Oct 21 06:10:18 2014
@@ -850,10 +850,12 @@ public class DistributedUpdateProcessor 
         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;
+            }
           }
         }
 



Mime
View raw message