diff --git a/client/internal/connect.go b/client/internal/connect.go index 6e1994f9662..5dacde74676 100644 --- a/client/internal/connect.go +++ b/client/internal/connect.go @@ -297,6 +297,9 @@ func (c *ConnectClient) run( } func (c *ConnectClient) Engine() *Engine { + if c == nil { + return nil + } var e *Engine c.engineMutex.Lock() e = c.engine @@ -305,8 +308,15 @@ func (c *ConnectClient) Engine() *Engine { } func (c *ConnectClient) Stop() error { + if c == nil { + return nil + } c.engineMutex.Lock() defer c.engineMutex.Unlock() + + if c.engine == nil { + return nil + } return c.engine.Stop() }