diff --git a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/NodeSeenService.java b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/NodeSeenService.java index 3bf3a846a8a27..c3aba27cf5f5f 100644 --- a/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/NodeSeenService.java +++ b/x-pack/plugin/shutdown/src/main/java/org/elasticsearch/xpack/shutdown/NodeSeenService.java @@ -52,6 +52,12 @@ public void clusterChanged(ClusterChangedEvent event) { } NodesShutdownMetadata eventShutdownMetadata = event.state().metadata().custom(NodesShutdownMetadata.TYPE); + + if (eventShutdownMetadata == null) { + // Since there's no shutdown metadata at all, we know no shutdowns have ever been registered and we can bail. + return; + } + final Set nodesNotPreviouslySeen = eventShutdownMetadata.getAllNodeMetadataMap() .values() .stream()