diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index 85fd450ad494fc55bd10f7641358cbceba8925d8..248e7811bba247f1cedf9f2c1b46ed7d057653a8 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -1067,9 +1067,10 @@ ChannelData::ChannelData(grpc_channel_element_args* args, grpc_error** error) return; } grpc_uri* uri = grpc_uri_parse(server_uri, true); - GPR_ASSERT(uri->path[0] != '\0'); - server_name_.reset( - gpr_strdup(uri->path[0] == '/' ? uri->path + 1 : uri->path)); + if (uri != nullptr && uri->path[0] != '\0') { + server_name_.reset( + gpr_strdup(uri->path[0] == '/' ? uri->path + 1 : uri->path)); + } grpc_uri_destroy(uri); char* proxy_name = nullptr; grpc_channel_args* new_args = nullptr; diff --git a/src/core/lib/gprpp/optional.h b/src/core/lib/gprpp/optional.h index 87d336ad6d0a339232d83e170229abd49e0c9a16..a8e3ce1505ee1f515eb41565528ffe8972d65a2f 100644 --- a/src/core/lib/gprpp/optional.h +++ b/src/core/lib/gprpp/optional.h @@ -38,8 +38,8 @@ class Optional { T value() const { return value_; } private: - bool set_ = false; T value_; + bool set_ = false; }; } /* namespace grpc_core */