fix openpitrix return non nil client when enpoint is empty (#2165)

This commit is contained in:
zryfish
2020-06-07 20:00:27 +08:00
committed by GitHub
parent df348b199f
commit 9b16c0589c
4 changed files with 74 additions and 25 deletions

View File

@@ -179,7 +179,7 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS
apiServer.AuditingClient = auditingClient
}
if s.OpenPitrixOptions != nil {
if s.OpenPitrixOptions != nil && !s.OpenPitrixOptions.IsEmpty() {
opClient, err := openpitrix.NewClient(s.OpenPitrixOptions)
if err != nil {
return nil, err