mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-01 07:21:17 +00:00
fix(smartplaylists): protect against nil panic
Signed-off-by: David <dvedvick@gmail.com>
This commit is contained in:
parent
4a6038cfaf
commit
0b4397bc2c
@ -79,11 +79,14 @@ func (c Criteria) ChildPlaylistPaths() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
if parent := c.Expression.(interface{ ChildPlaylistPaths() (paths []string) }); parent != nil {
|
||||
return parent.ChildPlaylistPaths()
|
||||
parent, ok := c.Expression.(interface{ ChildPlaylistPaths() []string })
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
return nil
|
||||
paths := parent.ChildPlaylistPaths()
|
||||
slices.Sort(paths)
|
||||
return slices.Compact(paths)
|
||||
}
|
||||
|
||||
func (c Criteria) MarshalJSON() ([]byte, error) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user