client: fix nil dereference when closing conns (#514)

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>

Co-authored-by: Yilin Chen <sticnarf@gmail.com>
This commit is contained in:
Lei Zhao 2022-05-31 16:17:49 +08:00 committed by GitHub
parent e69cd80e58
commit 2807409d49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -239,8 +239,10 @@ func (a *connArray) Close() {
}
for _, c := range a.v {
err := c.Close()
tikverr.Log(err)
if c != nil {
err := c.Close()
tikverr.Log(err)
}
}
close(a.done)