From 7f4459c41cdc6a313af4cd6acfb1df16e4316484 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 16 Jul 2022 05:59:27 -0700 Subject: [PATCH] [Repeat Album] Add a safety test to repeat list In case the current track isn't part of an album, or is otherwise not matching any albums in the playlist. Though the Album filter predicate wasn't working for a while due to changes. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 805e73efa..1bf0d50e0 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -1244,7 +1244,7 @@ static void *playlistControllerContext = &playlistControllerContext; if((i > [[self arrangedObjects] count] - 1) || ([[next album] caseInsensitiveCompare:[pe album]]) || ([next album] == nil)) { NSArray *filtered = [self filterPlaylistOnAlbum:[pe album]]; - if([pe album] == nil) + if([pe album] == nil || !filtered || [filtered count] < 1) i--; else i = [(PlaylistEntry *)filtered[0] index];