From fcc3d10cd27434511b1b398512fda21f01bc2b9c Mon Sep 17 00:00:00 2001 From: Antonio Date: Mon, 1 May 2023 12:34:12 +0800 Subject: [PATCH] sometimes no proxy --- tools/authenticator/main.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/authenticator/main.go b/tools/authenticator/main.go index c8182e0..f22721e 100644 --- a/tools/authenticator/main.go +++ b/tools/authenticator/main.go @@ -100,9 +100,15 @@ func main() { println(proxies[0].Socks5URL()) println(account.Email) println(account.Password) - authenticator := auth.NewAuthenticator(account.Email, account.Password, proxies[0].Socks5URL()) - // Push used proxy to the back of the list - proxies = append(proxies[1:], proxies[0]) + var proxy_url string + if len(proxies) == 0 { + proxy_url = "" + } else { + proxy_url = proxies[0].Socks5URL() + // Push used proxy to the back of the list + proxies = append(proxies[1:], proxies[0]) + } + authenticator := auth.NewAuthenticator(account.Email, account.Password, proxy_url) err := authenticator.Begin() if err.Error != nil { // println("Error: " + err.Details)