mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 11:54:01 +03:00
Do not panic if no addresses were found
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user