Skip to content

Commit db0df8d

Browse files
committed
Fixed potentially crash.
1 parent 6662379 commit db0df8d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Source/Filters/Video/YPVideoView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ public class YPVideoView: UIView {
2020
internal var previewImageView = UIImageView()
2121

2222
public var player: AVPlayer {
23-
guard playerLayer.player != nil else {
23+
guard let player = playerLayer.player else {
2424
return AVPlayer()
2525
}
26+
2627
playImageView.image = YPConfig.icons.playImage
27-
return playerLayer.player!
28+
return player
2829
}
2930

3031
public override init(frame: CGRect) {

0 commit comments

Comments
 (0)