[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 <kode54@gmail.com>
swiftingly
Christopher Snowhill 2022-06-15 19:55:29 -07:00
parent 8db2e41049
commit 02d2ab01a7
1 changed files with 1 additions and 1 deletions

View File

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