Skip to content

Commit

Permalink
Don't try to close a nil conn
Browse files Browse the repository at this point in the history
  • Loading branch information
Simeon Miteff committed Jun 13, 2023
1 parent 103e99c commit 646324c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,8 @@ func (c *Client) RemoteEndpointInfo() (uuid string, version string) {

// Close closes the underlying websocket connection.
func (c *Client) Close() error {
if c.conn == nil {
return errors.New("connection not open")
}
return c.conn.Close()
}

0 comments on commit 646324c

Please sign in to comment.