Kaynağa Gözat

What if authConfig or factory is Null?

Signed-off-by: Steven Taylor <steven.taylor@me.com>
Steven Taylor 10 yıl önce
ebeveyn
işleme
d1855c6cc0
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      registry/session.go

+ 1 - 1
registry/session.go

@@ -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)