Browse Source

Guard against null routing node iterator

Jason Tedor 9 years ago
parent
commit
8b37827ac6

+ 6 - 0
core/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java

@@ -415,6 +415,12 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent<Indic
 
         RoutingTable routingTable = event.state().routingTable();
         RoutingNodes.RoutingNodeIterator routingNode = event.state().getRoutingNodes().routingNodeIter(event.state().nodes().localNodeId());
+
+        if (routingNode == null) {
+            failedShards.clear();
+            return;
+        }
+
         DiscoveryNodes nodes = event.state().nodes();
 
         for (final ShardRouting shardRouting : routingNode) {