From 931da40b4d7603263a2b7945f5247ec310eb835e Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 15 Feb 2025 17:08:02 -0800 Subject: [PATCH] Bug Fix: Safeguard play count updates Play Count cannot be updated for tracks which have been deleted before the update was added to them. This was another cause of a rare crash. 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 8e42b7b07..0ecc94658 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -251,7 +251,7 @@ static void *playlistControllerContext = &playlistControllerContext; } - (void)updatePlayCountForTrack:(PlaylistEntry *)pe { - if(pe.countAdded) return; + if(!pe || pe.deLeted || pe.countAdded) return; pe.countAdded = YES; __block PlayCount *pc = pe.playCountItem;