Playback Notifications: Prevent crash when notifying a track with unusable album artwork

CQTexperiment
Christopher Snowhill 2022-01-11 20:39:10 -08:00
parent 557e0bd399
commit 3b62842021
1 changed files with 18 additions and 15 deletions

View File

@ -208,6 +208,8 @@ typedef NS_ENUM(NSInteger, TrackStatus) { TrackPlaying, TrackPaused, TrackStoppe
CGImageRef cgRef = [image CGImageForProposedRect:NULL
context:nil
hints:nil];
if (cgRef) {
NSBitmapImageRep *newRep =
[[NSBitmapImageRep alloc] initWithCGImage:cgRef];
NSData *jpgData = [newRep
@ -228,6 +230,7 @@ typedef NS_ENUM(NSInteger, TrackStatus) { TrackPlaying, TrackPaused, TrackStoppe
}
}
}
}
UNNotificationRequest *request =
[UNNotificationRequest requestWithIdentifier:@"PlayTrack"