Don't log a panic when there are no releases
This commit is contained in:
parent
fbd22e7b94
commit
fa9df4dc5e
|
@ -93,6 +93,10 @@ func currentRelease() (githubRelease, error) {
|
||||||
json.NewDecoder(resp.Body).Decode(&rels)
|
json.NewDecoder(resp.Body).Decode(&rels)
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
|
|
||||||
|
if len(rels) == 0 {
|
||||||
|
return githubRelease{}, errors.New("no releases found")
|
||||||
|
}
|
||||||
|
|
||||||
if strings.Contains(Version, "-beta") {
|
if strings.Contains(Version, "-beta") {
|
||||||
// We are a beta version. Use whatever we can find that is newer-or-equal than current.
|
// We are a beta version. Use whatever we can find that is newer-or-equal than current.
|
||||||
for _, rel := range rels {
|
for _, rel := range rels {
|
||||||
|
|
Loading…
Reference in New Issue