From f22c352d34709fbf1a589455a1eab8ea00d967c6 Mon Sep 17 00:00:00 2001 From: Drew Baugher Date: Tue, 10 Dec 2019 13:13:42 -0800 Subject: [PATCH] Adds null check in cluster changed event sweep --- .../indexstatemanagement/ManagedIndexCoordinator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/amazon/opendistroforelasticsearch/indexstatemanagement/ManagedIndexCoordinator.kt b/src/main/kotlin/com/amazon/opendistroforelasticsearch/indexstatemanagement/ManagedIndexCoordinator.kt index 3ff04627d..c1fa61fb2 100644 --- a/src/main/kotlin/com/amazon/opendistroforelasticsearch/indexstatemanagement/ManagedIndexCoordinator.kt +++ b/src/main/kotlin/com/amazon/opendistroforelasticsearch/indexstatemanagement/ManagedIndexCoordinator.kt @@ -231,7 +231,7 @@ class ManagedIndexCoordinator( @OpenForTesting suspend fun sweepClusterChangedEvent(event: ClusterChangedEvent) { val indicesDeletedRequests = event.indicesDeleted() - .filter { event.previousState().metaData().index(it).getPolicyID() != null } + .filter { event.previousState().metaData().index(it)?.getPolicyID() != null } .map { deleteManagedIndexRequest(it.uuid) } /*