Skip to content

Commit

Permalink
fix(playlist): check error before assuming playlist loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiamoe committed Jul 3, 2024
1 parent 0e2aae7 commit 40adf1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/ctrlsubsonic/handlers_playlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ func (c *Controller) ServeCreateOrUpdatePlaylist(r *http.Request) *spec.Response
playlistPath := playlistIDDecode(playlistID)

var playlist playlistp.Playlist
if pl, _ := c.playlistStore.Read(playlistPath); pl != nil {
playlist = *pl
if playlistPath != "" {
if pl, err := c.playlistStore.Read(playlistPath); err != nil && pl != nil {
playlist = *pl
}
}

if playlist.UserID != 0 && playlist.UserID != user.ID {
Expand Down

0 comments on commit 40adf1e

Please sign in to comment.