diff --git a/internal/updater/checker.go b/internal/updater/checker.go index 25118d0..cd540dd 100644 --- a/internal/updater/checker.go +++ b/internal/updater/checker.go @@ -102,11 +102,15 @@ func CheckUpdate(force bool) *UpdateInfo { client := &http.Client{Timeout: httpTimeout} resp, err := client.Do(req) - if err != nil || resp == nil || resp.StatusCode != http.StatusOK { + if err != nil || resp == nil { return nil } defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return nil + } + var release struct { TagName string `json:"tag_name"` HTMLURL string `json:"html_url"`