Skip to content

Commit 01aa7cb

Browse files
authored
Merge pull request moby#4221 from aaronlehmann/authprovider-nil-logger
authprovider: Fix error return from Credentials when logger is nil
2 parents a5bccca + 95e5f6b commit 01aa7cb

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
@@ -152,7 +152,7 @@ func (ap *authProvider) Credentials(ctx context.Context, req *auth.CredentialsRe
152152
defer ap.mu.Unlock()
153153
_, ok := ap.loggerCache[req.Host]
154154
ap.loggerCache[req.Host] = struct{}{}
155-
if !ok {
155+
if !ok && ap.logger != nil {
156156
return resp, progresswriter.Wrap(fmt.Sprintf("[auth] sharing credentials for %s", req.Host), ap.logger, func(progresswriter.SubLogger) error {
157157
return err
158158
})

0 commit comments

Comments
 (0)