Skip to content

Commit

Permalink
fix: check []bytes > 0 instead of nil (#2667)
Browse files Browse the repository at this point in the history
Fixes: #2647
  • Loading branch information
codyoss committed Jul 2, 2024
1 parent e84fa65 commit 711eb91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/creds.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func baseCreds(ctx context.Context, ds *DialSettings) (*google.Credentials, erro
if ds.Credentials != nil {
return ds.Credentials, nil
}
if ds.CredentialsJSON != nil {
if len(ds.CredentialsJSON) > 0 {
return credentialsFromJSON(ctx, ds.CredentialsJSON, ds)
}
if ds.CredentialsFile != "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (ds *DialSettings) Validate() error {
if ds.Credentials != nil {
nCreds++
}
if ds.CredentialsJSON != nil {
if len(ds.CredentialsJSON) > 0 {
nCreds++
}
if ds.CredentialsFile != "" {
Expand Down

0 comments on commit 711eb91

Please sign in to comment.