diff --git a/include/grpc++/security/credentials.h b/include/grpc++/security/credentials.h index 01b9710f6b3..fafcfdc9061 100644 --- a/include/grpc++/security/credentials.h +++ b/include/grpc++/security/credentials.h @@ -177,7 +177,7 @@ class MetadataCredentialsPlugin { // a different thread from the one processing the call. virtual bool IsBlocking() const { return true; } - // Gets the auth metatada produced by this plugin. */ + // Gets the auth metatada produced by this plugin. virtual Status GetMetadata( grpc::string_ref service_url, std::multimap* metadata) = 0; diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index 8333b01f29b..99b7468e865 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -183,7 +183,7 @@ void MetadataCredentialsPluginWrapper::InvokePlugin( 0, {{nullptr, nullptr, nullptr, nullptr}}}); } - cb(user_data, &md[0], md.size(), + cb(user_data, md.empty() ? nullptr : &md[0], md.size(), static_cast(status.error_code()), status.error_message().c_str()); }