Don't log a panic when there are no releases

This commit is contained in:
Jakob Borg 2014-07-31 09:04:57 +02:00
parent fbd22e7b94
commit fa9df4dc5e
1 changed files with 4 additions and 0 deletions

View File

@ -93,6 +93,10 @@ func currentRelease() (githubRelease, error) {
json.NewDecoder(resp.Body).Decode(&rels)
resp.Body.Close()
if len(rels) == 0 {
return githubRelease{}, errors.New("no releases found")
}
if strings.Contains(Version, "-beta") {
// We are a beta version. Use whatever we can find that is newer-or-equal than current.
for _, rel := range rels {