Merge pull request #345 from 9seconds/fix-no-addresses

Do not panic if no addresses were found
This commit is contained in:
Sergei Arkhipov
2026-02-26 13:35:47 +01:00
committed by GitHub
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ func (u *updater) run(ctx context.Context, callback func() error) {
for {
u.logger.Info("start update")
if err := callback(); err != nil {
u.logger.WarningError("cannot update: %w", err)
u.logger.WarningError("cannot update", err)
}
u.logger.Info("updated")
+3
View File
@@ -252,6 +252,9 @@ func (p *Proxy) doTelegramCall(ctx *streamContext) error {
if err != nil {
return fmt.Errorf("no addresses to call: %w", err)
}
if conn == nil {
return fmt.Errorf("no available addresses for DC %d", ctx.dc)
}
tgConn, err := foundAddr.Obfuscator.SendHandshake(conn, ctx.dc)
if err != nil {