From 97ec33c54b95ca60917c90afd7a29ae2e52bcf13 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 26 May 2026 20:37:30 -0500 Subject: [PATCH] fix(smartplaylists): protect against nil panic Signed-off-by: David --- model/criteria/criteria.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/model/criteria/criteria.go b/model/criteria/criteria.go index 2e9b1b652..f36f76d25 100644 --- a/model/criteria/criteria.go +++ b/model/criteria/criteria.go @@ -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) {