mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 16:24:03 +03:00
Merge pull request #345 from 9seconds/fix-no-addresses
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 {
|
for {
|
||||||
u.logger.Info("start update")
|
u.logger.Info("start update")
|
||||||
if err := callback(); err != nil {
|
if err := callback(); err != nil {
|
||||||
u.logger.WarningError("cannot update: %w", err)
|
u.logger.WarningError("cannot update", err)
|
||||||
}
|
}
|
||||||
u.logger.Info("updated")
|
u.logger.Info("updated")
|
||||||
|
|
||||||
|
|||||||
@@ -252,6 +252,9 @@ func (p *Proxy) doTelegramCall(ctx *streamContext) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("no addresses to call: %w", err)
|
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)
|
tgConn, err := foundAddr.Obfuscator.SendHandshake(conn, ctx.dc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user