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 93739d5a0d
commit d32ccd3d1e

View file

@ -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);