mirror of https://github.com/docker/docs.git
Merge pull request #12417 from hashneo/patch-1
What if authConfig or factory is Nill?
This commit is contained in:
commit
6b8d8a5847
|
@ -54,7 +54,7 @@ func NewSession(authConfig *cliconfig.AuthConfig, factory *requestdecorator.Requ
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if info.Standalone {
|
if info.Standalone && authConfig != nil && factory != nil {
|
||||||
logrus.Debugf("Endpoint %s is eligible for private registry. Enabling decorator.", r.indexEndpoint.String())
|
logrus.Debugf("Endpoint %s is eligible for private registry. Enabling decorator.", r.indexEndpoint.String())
|
||||||
dec := requestdecorator.NewAuthDecorator(authConfig.Username, authConfig.Password)
|
dec := requestdecorator.NewAuthDecorator(authConfig.Username, authConfig.Password)
|
||||||
factory.AddDecorator(dec)
|
factory.AddDecorator(dec)
|
||||||
|
|
Loading…
Reference in New Issue