Move declaration order to how it was earlier in optional, and if check for uri

reviewable/pr18746/r9
Yash Tibrewal 6 years ago
parent d3035a3d5f
commit 79c3990d50
  1. 7
      src/core/ext/filters/client_channel/client_channel.cc
  2. 2
      src/core/lib/gprpp/optional.h

@ -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;

@ -38,8 +38,8 @@ class Optional {
T value() const { return value_; }
private:
bool set_ = false;
T value_;
bool set_ = false;
};
} /* namespace grpc_core */

Loading…
Cancel
Save