Skip to content

Commit

Permalink
website/public: fix faves not loading with no nickname argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed Jun 13, 2024
1 parent cc65e0a commit 5b5cdb4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions website/public/faves.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ func NewFavesInput(ss radio.SongStorage, rs radio.RequestStorage, r *http.Reques
nickname = r.FormValue("nick")
}

faves, faveCount, err := ss.FavoritesOf(nickname, favesPageSize, offset)
if err != nil {
return nil, errors.E(op, err)
var faves []radio.Song
var faveCount int64
if nickname != "" { // only ask for faves if we have a nickname
faves, faveCount, err = ss.FavoritesOf(nickname, favesPageSize, offset)
if err != nil {
return nil, errors.E(op, err)
}
}

// create download URL
Expand Down

0 comments on commit 5b5cdb4

Please sign in to comment.