Fix double unlock in client.go

This commit is contained in:
Zoltán Papp
2024-06-03 20:14:39 +02:00
parent 57ddb5f262
commit 9d44a476c6
2 changed files with 2 additions and 4 deletions

View File

@ -79,16 +79,14 @@ func (c *Client) Connect() error {
defer c.readLoopMutex.Unlock()
c.mu.Lock()
defer c.mu.Unlock()
if c.serviceIsRunning {
c.mu.Unlock()
return nil
}
c.mu.Unlock()
err := c.connect()
if err != nil {
c.mu.Unlock()
return err
}