mirror of
https://github.com/MedzikUser/go-github-selfupdate.git
synced 2024-08-15 03:25:29 +00:00
fix checking response when API returns an error
This commit is contained in:
parent
11f67e340f
commit
ed171e0fb6
1 changed files with 1 additions and 1 deletions
|
@ -88,7 +88,7 @@ func (d *ReleaseDetector) DetectLatest(slug string) (release *Release, found boo
|
|||
rels, res, err := d.api.Repositories.ListReleases(d.apiCtx, repo[0], repo[1], nil)
|
||||
if err != nil {
|
||||
log.Println("API returned an error response:", err)
|
||||
if res.StatusCode == 404 {
|
||||
if res != nil && res.StatusCode == 404 {
|
||||
// 404 means repository not found or release not found. It's not an error here.
|
||||
found = false
|
||||
err = nil
|
||||
|
|
Loading…
Reference in a new issue