connector/client: don't explode if client not available on connection state change

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-11-20 15:33:55 -07:00
parent 21ef73d69c
commit 844f31827c
+4
View File
@@ -417,6 +417,10 @@ func (t *TelegramClient) onConnectionStateChange(reason string) func() {
log.Info().Msg("Connection state changed")
ctx := log.WithContext(context.Background())
if t.client == nil {
return
}
authStatus, err := t.client.Auth().Status(ctx)
if err != nil {
t.sendUnknownError(err.Error())