Skip to content

Commit 8311fba

Browse files
Merge pull request #86 from depot/fix-nil-panic
Fix nil panic when logger is nil
2 parents ce9540e + 34a1f20 commit 8311fba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

session/auth/authprovider/authprovider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (ap *authProvider) Credentials(ctx context.Context, req *auth.CredentialsRe
151151
defer ap.mu.Unlock()
152152
_, ok := ap.loggerCache[req.Host]
153153
ap.loggerCache[req.Host] = struct{}{}
154-
if !ok {
154+
if !ok && ap.logger != nil {
155155
return resp, progresswriter.Wrap(fmt.Sprintf("[auth] sharing credentials for %s", req.Host), ap.logger, func(progresswriter.SubLogger) error {
156156
return err
157157
})

0 commit comments

Comments
 (0)