Fix bugprone-stringview-nullptr (#28678)

pull/28682/head
Esun Kim 3 years ago committed by GitHub
parent 7138f1e854
commit 5993fa7558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/core/lib/iomgr/resolve_address_custom.cc
  2. 2
      src/core/lib/iomgr/resolve_address_posix.cc

@ -80,7 +80,7 @@ absl::Status TrySplitHostPort(absl::string_view name,
}
if (port->empty()) {
// TODO(murgatroid99): add tests for this case
if (default_port == nullptr) {
if (default_port.empty()) {
return absl::UnknownError(absl::StrFormat("no port in name '%s'", name));
}
*port = std::string(default_port);

@ -121,7 +121,7 @@ NativeDNSResolver::ResolveNameBlocking(absl::string_view name,
goto done;
}
if (port.empty()) {
if (default_port == nullptr) {
if (default_port.empty()) {
err = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("no port in name"),
GRPC_ERROR_STR_TARGET_ADDRESS, name);

Loading…
Cancel
Save