diff --git a/source/common/upstream/cluster_manager_impl.cc b/source/common/upstream/cluster_manager_impl.cc index 8880e01ff547..b7466fec42b6 100644 --- a/source/common/upstream/cluster_manager_impl.cc +++ b/source/common/upstream/cluster_manager_impl.cc @@ -453,7 +453,9 @@ bool ClusterManagerImpl::addOrUpdateCluster(const envoy::api::v2::Cluster& clust existing_warming_cluster != warming_clusters_.end()) { // The following init manager remove call is a NOP in the case we are already initialized. It's // just kept here to avoid additional logic. - init_helper_.removeCluster(*existing_active_cluster->second->cluster_); + if (existing_active_cluster != active_clusters_.end()) { + init_helper_.removeCluster(*existing_active_cluster->second->cluster_); + } cm_stats_.cluster_modified_.inc(); } else { cm_stats_.cluster_added_.inc();