Skip to content

Commit

Permalink
fix panic error
Browse files Browse the repository at this point in the history
  • Loading branch information
wenxuwan committed Dec 3, 2020
1 parent 2b8aad0 commit ee35594
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions registry/zookeeper/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ func (r *zkRegistry) registerTempZookeeperNode(root string, node string) error {

r.cltLock.Lock()
defer r.cltLock.Unlock()
if r.client == nil{
return perrors.WithStack(perrors.New("zk client already been closed"))
}
err = r.client.Create(root)
if err != nil {
logger.Errorf("zk.Create(root{%s}) = err{%v}", root, perrors.WithStack(err))
Expand Down

0 comments on commit ee35594

Please sign in to comment.