diff --git a/src/core/ext/xds/xds_listener.h b/src/core/ext/xds/xds_listener.h index a791e3fe55c67..cb6cb06f518a8 100644 --- a/src/core/ext/xds/xds_listener.h +++ b/src/core/ext/xds/xds_listener.h @@ -76,9 +76,10 @@ struct XdsListenerResource : public XdsResourceType::ResourceData { } else { auto& rc1 = absl::get>( route_config); - auto& rc2 = absl::get>( - other.route_config); - if (!(*rc1 == *rc2)) return false; + auto* rc2 = absl::get_if>( + &other.route_config); + if (rc2 == nullptr) return false; + if (!(*rc1 == **rc2)) return false; } return http_max_stream_duration == other.http_max_stream_duration && http_filters == other.http_filters;