Skip to content

Commit

Permalink
Don't log a panic when there are no releases
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Jul 31, 2014
1 parent fbd22e7 commit fa9df4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/syncthing/upgrade_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fa9df4d

Please sign in to comment.