Release the authorization lock on client initialization error

This commit is contained in:
Bohdan Horbeshko 2022-05-13 18:32:11 -04:00
parent b3edc45526
commit 25e8c98c3e

View file

@ -112,6 +112,7 @@ func (c *Client) Connect(resource string) error {
tdlibClient, err := client.NewClient(c.authorizer, c.options...)
if err != nil {
c.locks.authorizationReady.Done()
return errors.Wrap(err, "Couldn't initialize a Telegram client instance")
}