Skip to content

Commit 711eb91

Browse files
authored
fix: check []bytes > 0 instead of nil (#2667)
Fixes: #2647
1 parent e84fa65 commit 711eb91

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: internal/creds.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func baseCreds(ctx context.Context, ds *DialSettings) (*google.Credentials, erro
127127
if ds.Credentials != nil {
128128
return ds.Credentials, nil
129129
}
130-
if ds.CredentialsJSON != nil {
130+
if len(ds.CredentialsJSON) > 0 {
131131
return credentialsFromJSON(ctx, ds.CredentialsJSON, ds)
132132
}
133133
if ds.CredentialsFile != "" {

Diff for: internal/settings.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (ds *DialSettings) Validate() error {
126126
if ds.Credentials != nil {
127127
nCreds++
128128
}
129-
if ds.CredentialsJSON != nil {
129+
if len(ds.CredentialsJSON) > 0 {
130130
nCreds++
131131
}
132132
if ds.CredentialsFile != "" {

0 commit comments

Comments
 (0)