Explorar el Código

Do not panic if no addresses were found

tags/v2.1.12^2^2
9seconds hace 2 meses
padre
commit
449f84133a
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  1. 1
    1
      mtglib/internal/dc/updater.go
  2. 3
    0
      mtglib/proxy.go

+ 1
- 1
mtglib/internal/dc/updater.go Ver fichero

32
 		for {
32
 		for {
33
 			u.logger.Info("start update")
33
 			u.logger.Info("start update")
34
 			if err := callback(); err != nil {
34
 			if err := callback(); err != nil {
35
-				u.logger.WarningError("cannot update: %w", err)
35
+				u.logger.WarningError("cannot update", err)
36
 			}
36
 			}
37
 			u.logger.Info("updated")
37
 			u.logger.Info("updated")
38
 
38
 

+ 3
- 0
mtglib/proxy.go Ver fichero

252
 	if err != nil {
252
 	if err != nil {
253
 		return fmt.Errorf("no addresses to call: %w", err)
253
 		return fmt.Errorf("no addresses to call: %w", err)
254
 	}
254
 	}
255
+	if conn == nil {
256
+		return fmt.Errorf("no available addresses for DC %d", ctx.dc)
257
+	}
255
 
258
 
256
 	tgConn, err := foundAddr.Obfuscator.SendHandshake(conn, ctx.dc)
259
 	tgConn, err := foundAddr.Obfuscator.SendHandshake(conn, ctx.dc)
257
 	if err != nil {
260
 	if err != nil {

Loading…
Cancelar
Guardar