Skip to content

Commit

Permalink
Propagate grpc_google_default_credentials_create errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rauls5382 committed Mar 3, 2015
1 parent 79c7f85 commit 02fe58d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpp/client/credentials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 02fe58d

Please sign in to comment.