From 3c4e8a9be2a7900580e52b00cdea4f0f7f0a40a9 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Wed, 8 May 2019 15:46:32 -0700 Subject: [PATCH] Fix test failure --- src/core/ext/filters/client_channel/client_channel.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index 1dc6ac48d57..9144df93c12 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -1265,8 +1265,12 @@ bool ChannelData::ProcessResolverResultLocked( strcmp(service_config->service_config_json(), chand->saved_service_config_->service_config_json()) != 0); if (service_config_changed) { - service_config_json.reset( - gpr_strdup(service_config->service_config_json())); + if (service_config != nullptr) { + service_config_json.reset( + gpr_strdup(service_config->service_config_json())); + } else { + service_config_json.reset(gpr_strdup("")); + } if (grpc_client_channel_routing_trace.enabled()) { gpr_log(GPR_INFO, "chand=%p: resolver returned service config: \"%s\"", chand, service_config_json.get());