Skip to content

Commit

Permalink
fix conn client check and validate engine
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsmaycon committed Sep 5, 2024
1 parent fb0b248 commit 6647140
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/internal/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (c *ConnectClient) run(
}

func (c *ConnectClient) Engine() *Engine {
if c.engine == nil {
if c == nil {
return nil
}
var e *Engine
Expand All @@ -308,11 +308,15 @@ func (c *ConnectClient) Engine() *Engine {
}

func (c *ConnectClient) Stop() error {
if c.engine == nil {
if c == nil {
return nil
}
c.engineMutex.Lock()
defer c.engineMutex.Unlock()

if c.engine == nil {
return nil
}
return c.engine.Stop()
}

Expand Down

0 comments on commit 6647140

Please sign in to comment.