From 9331d16a028e7042f10b9880b7fc15a2f8fdc0b5 Mon Sep 17 00:00:00 2001 From: Tamas Papik Date: Wed, 26 May 2021 14:33:19 +0200 Subject: [PATCH] avoid nil resp when there is an error (#74) --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index dd39cb0..cfd2331 100755 --- a/main.go +++ b/main.go @@ -81,7 +81,7 @@ func main() { client := &http.Client{} resp, err := client.Do(req) - if resp.StatusCode != http.StatusOK || err != nil { + if err != nil || resp.StatusCode != http.StatusOK { resp, err = client.Do(req) if err != nil { failf("Failed to get http response, error: %s", err)