diff --git a/core/client.go b/core/client.go index fc9f33ede..0507218c5 100644 --- a/core/client.go +++ b/core/client.go @@ -226,7 +226,10 @@ func (c *Client) Close() error { return nil } - c.conn.CloseWithError(yerr.ErrorCodeClientAbort.To(), "client ask to close") + if c.conn != nil { + c.conn.CloseWithError(yerr.ErrorCodeClientAbort.To(), "client ask to close") + } + return c.close() }