mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-18 07:30:29 +00:00
fix(smartplaylists): protect against nil panic
Signed-off-by: David <dvedvick@gmail.com>
This commit is contained in:
parent
66896435b7
commit
97ec33c54b
@ -83,11 +83,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