Playback Notifications: Prevent crash when notifying a track with unusable album artwork
parent
557e0bd399
commit
3b62842021
|
@ -208,6 +208,8 @@ typedef NS_ENUM(NSInteger, TrackStatus) { TrackPlaying, TrackPaused, TrackStoppe
|
||||||
CGImageRef cgRef = [image CGImageForProposedRect:NULL
|
CGImageRef cgRef = [image CGImageForProposedRect:NULL
|
||||||
context:nil
|
context:nil
|
||||||
hints:nil];
|
hints:nil];
|
||||||
|
|
||||||
|
if (cgRef) {
|
||||||
NSBitmapImageRep *newRep =
|
NSBitmapImageRep *newRep =
|
||||||
[[NSBitmapImageRep alloc] initWithCGImage:cgRef];
|
[[NSBitmapImageRep alloc] initWithCGImage:cgRef];
|
||||||
NSData *jpgData = [newRep
|
NSData *jpgData = [newRep
|
||||||
|
@ -228,6 +230,7 @@ typedef NS_ENUM(NSInteger, TrackStatus) { TrackPlaying, TrackPaused, TrackStoppe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UNNotificationRequest *request =
|
UNNotificationRequest *request =
|
||||||
[UNNotificationRequest requestWithIdentifier:@"PlayTrack"
|
[UNNotificationRequest requestWithIdentifier:@"PlayTrack"
|
||||||
|
|
Loading…
Reference in New Issue