From 0b4397bc2cbae091b77e141f1a09b968b38a3dd6 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 c213872ad..e0bee24a0 100644 --- a/model/criteria/criteria.go +++ b/model/criteria/criteria.go @@ -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) {