diff --git a/docs/session.go b/docs/session.go index dd868a2b3..f7358bc10 100644 --- a/docs/session.go +++ b/docs/session.go @@ -54,7 +54,7 @@ func NewSession(authConfig *cliconfig.AuthConfig, factory *requestdecorator.Requ 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)