diff options
author | Raul Silvera <rsilvera@google.com> | 2015-03-02 18:42:19 -0800 |
---|---|---|
committer | Raul Silvera <rsilvera@google.com> | 2015-03-02 18:42:19 -0800 |
commit | 02fe58d1bdbc995a58b3b8a4fc65a78405cc2693 (patch) | |
tree | 0609af97b05cc149dae49ebb1f53a9f168e487d1 /src | |
parent | 79c7f85ba720f1cfaa004b72c9f11b784bdaffab (diff) |
Propagate grpc_google_default_credentials_create errors
Diffstat (limited to 'src')
-rw-r--r-- | src/cpp/client/credentials.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cpp/client/credentials.cc b/src/cpp/client/credentials.cc index a140f551e0..eff0892810 100644 --- a/src/cpp/client/credentials.cc +++ b/src/cpp/client/credentials.cc @@ -47,7 +47,8 @@ grpc_credentials *Credentials::GetRawCreds() { return creds_; } std::unique_ptr<Credentials> CredentialsFactory::GoogleDefaultCredentials() { grpc_credentials *c_creds = grpc_google_default_credentials_create(); - std::unique_ptr<Credentials> cpp_creds(new Credentials(c_creds)); + std::unique_ptr<Credentials> cpp_creds( + c_creds == nullptr ? nullptr : new Credentials(c_creds)); return cpp_creds; } |