mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-24 23:13:59 -04:00
[client] Prevent panic on nil connection during Close
This commit is contained in:
@@ -88,6 +88,10 @@ func (c *GRPCClient) Close() error {
|
||||
c.clientConn = nil
|
||||
c.mu.Unlock()
|
||||
|
||||
if conn == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := conn.Close(); err != nil && !errors.Is(err, context.Canceled) {
|
||||
return fmt.Errorf("close client connection: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user