From 02d2ab01a762a779dda4ce63476506851426d604 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 15 Jun 2022 19:55:29 -0700 Subject: [PATCH] [Notifications] Prevent crash on deleted tracks Prevent an unhandled exception when a notification is sent on a track which has been deleted from the playlist. Signed-off-by: Christopher Snowhill --- Application/PlaybackEventController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/PlaybackEventController.m b/Application/PlaybackEventController.m index e9dcd99ce..7d71bd883 100644 --- a/Application/PlaybackEventController.m +++ b/Application/PlaybackEventController.m @@ -112,7 +112,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response - (NSDictionary *)fillNotificationDictionary:(PlaylistEntry *)pe status:(TrackStatus)status { NSMutableDictionary *dict = [NSMutableDictionary dictionary]; - if(pe == nil) return dict; + if(pe == nil || pe.deleted || [pe URL] == nil) return dict; [dict setObject:[[pe URL] absoluteString] forKey:TrackPath]; if([pe title]) [dict setObject:[pe title] forKey:TrackTitle];