Protect when animatedImage does not have CGImage (not possible in real situation)
This commit is contained in:
parent
8b1dfc01cf
commit
ad067f7b4e
|
@ -78,8 +78,12 @@ public final class ImagePlayer : ObservableObject {
|
|||
|
||||
self.player = imagePlayer
|
||||
|
||||
let posterFrame = PlatformImage(cgImage: animatedImage.cgImage!, scale: animatedImage.scale, orientation: .up)
|
||||
currentFrame = posterFrame
|
||||
// Setup poster frame
|
||||
if let cgImage = animatedImage.cgImage {
|
||||
currentFrame = PlatformImage(cgImage: cgImage, scale: animatedImage.scale, orientation: .up)
|
||||
} else {
|
||||
currentFrame = .empty
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue