diff --git a/src/test/java/org/elasticsearch/cluster/ack/AckClusterUpdateSettingsTests.java b/src/test/java/org/elasticsearch/cluster/ack/AckClusterUpdateSettingsTests.java index 8ba371aa5ae..3305469c780 100644 --- a/src/test/java/org/elasticsearch/cluster/ack/AckClusterUpdateSettingsTests.java +++ b/src/test/java/org/elasticsearch/cluster/ack/AckClusterUpdateSettingsTests.java @@ -101,7 +101,8 @@ public class AckClusterUpdateSettingsTests extends ElasticsearchIntegrationTest for (IndexRoutingTable indexRoutingTable : clusterState.routingTable()) { for (IndexShardRoutingTable indexShardRoutingTable : indexRoutingTable) { for (ShardRouting shardRouting : indexShardRoutingTable) { - if (clusterState.nodes().get(shardRouting.currentNodeId()).id().equals(excludedNodeId)) { + assert clusterState.nodes() != null; + if (shardRouting.unassigned() == false && clusterState.nodes().get(shardRouting.currentNodeId()).id().equals(excludedNodeId)) { //if the shard is still there it must be relocating and all nodes need to know, since the request was acknowledged //reroute happens as part of the update settings and we made sure no throttling comes into the picture via settings assertThat(shardRouting.relocating(), equalTo(true));