1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

What if authConfig or factory is Null?

Signed-off-by: Steven Taylor <steven.taylor@me.com>
This commit is contained in:
Steven Taylor 2015-04-15 15:30:09 -07:00
parent 2e4d36ed80
commit d1855c6cc0

View file

@ -53,7 +53,7 @@ func NewSession(authConfig *AuthConfig, factory *requestdecorator.RequestFactory
if err != nil {
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())
dec := requestdecorator.NewAuthDecorator(authConfig.Username, authConfig.Password)
factory.AddDecorator(dec)