From 5f116359dfc380f35f40f1abe17e81b8429bf325 Mon Sep 17 00:00:00 2001 From: wurui Date: Mon, 29 Aug 2022 14:26:27 +0800 Subject: [PATCH] fix(connection): conn nil pointer panic (#372) --- core/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() }