From 25e8c98c3ea2e9249416e70cea6c9818757ddff2 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Fri, 13 May 2022 18:32:11 -0400 Subject: [PATCH] Release the authorization lock on client initialization error --- telegram/connect.go | 1 + 1 file changed, 1 insertion(+) diff --git a/telegram/connect.go b/telegram/connect.go index a4dfa37..37f719e 100644 --- a/telegram/connect.go +++ b/telegram/connect.go @@ -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") }