diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java b/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java index 48167e8faf9..7339ed63fbd 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java @@ -147,7 +147,7 @@ public class ZenDiscovery extends AbstractLifecycleComponent implemen nodesFD.stop(); initialStateSent.set(false); if (sendLeaveRequest) { - if (!master) { + if (!master && latestDiscoNodes.masterNode() != null) { try { membership.sendLeaveRequestBlocking(latestDiscoNodes.masterNode(), localNode, TimeValue.timeValueSeconds(1)); } catch (Exception e) {