From c3511ea5e70911d359bbcfc933da15aa4fa09917 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Tue, 1 Jul 2025 04:45:38 -0700 Subject: [PATCH] Playlist: Add safety checks to update total length Update total length had a mysterious crash for some user, hopefully this will fix it. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistController.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 4841a8396..c96042c53 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -374,7 +374,9 @@ static void *playlistControllerContext = &playlistControllerContext; ldiv_t weeksAndDays; for(PlaylistEntry *pe in [self arrangedObjects]) { - if(!isnan([pe.length doubleValue])) tt += [pe.length doubleValue]; + if(pe && !pe.deLeted && pe.length) { + if(!isnan([pe.length doubleValue])) tt += [pe.length doubleValue]; + } } long sec = (long)(tt);