From d01f7cd3d6cf32f482430de3913cb365f3f7bc33 Mon Sep 17 00:00:00 2001 From: Simeon Miteff Date: Wed, 14 Jun 2023 15:33:46 +1000 Subject: [PATCH] More seatbelts --- pkg/client/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/client/client.go b/pkg/client/client.go index 2b35012..0ede7b5 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -116,6 +116,9 @@ func (c *Client) RemoteEndpointInfo() (uuid string, version string) { // Close closes the underlying websocket connection. func (c *Client) Close() error { + if c == nil { + return errors.New("closing nil client") + } if c.conn == nil { return errors.New("connection not open") }