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 <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2025-07-01 04:45:38 -07:00
parent 3f7ec658fe
commit c3511ea5e7

View file

@ -374,7 +374,9 @@ static void *playlistControllerContext = &playlistControllerContext;
ldiv_t weeksAndDays; ldiv_t weeksAndDays;
for(PlaylistEntry *pe in [self arrangedObjects]) { 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); long sec = (long)(tt);