From 5b5cdb46c0a72ba6daf020f72ef6f0aeeee4f0ce Mon Sep 17 00:00:00 2001 From: Wessie Date: Thu, 13 Jun 2024 18:58:16 +0100 Subject: [PATCH] website/public: fix faves not loading with no nickname argument --- website/public/faves.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/website/public/faves.go b/website/public/faves.go index 4484dba8..9f32cf89 100644 --- a/website/public/faves.go +++ b/website/public/faves.go @@ -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