mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Fix panic when version check times out (#374)
This commit is contained in:
@@ -124,14 +124,14 @@ func GetLatestVersion(shortHash bool) (latestVersion string, latestRelease strin
|
||||
|
||||
release := githubReleasesResponse{}
|
||||
|
||||
if response.StatusCode != http.StatusOK {
|
||||
return "", "", fmt.Errorf("Github API request failed: %s", response.Status)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return "", "", fmt.Errorf("Github API request failed: %s", err)
|
||||
}
|
||||
|
||||
if response.StatusCode != http.StatusOK {
|
||||
return "", "", fmt.Errorf("Github API request failed: %s", response.Status)
|
||||
}
|
||||
|
||||
defer response.Body.Close()
|
||||
|
||||
data, err := ioutil.ReadAll(response.Body)
|
||||
|
||||
Reference in New Issue
Block a user