From fffe9731c7c0d34aecba97ab3c667d2d48d219af Mon Sep 17 00:00:00 2001 From: happyfloat <64045340+happyfloat@users.noreply.github.com> Date: Wed, 7 Dec 2022 12:16:03 +0100 Subject: [PATCH] Update RCTVideo.swift Prevents a crash in my case: https://github.com/react-native-video/react-native-video/issues/2723#issuecomment-1336130120 --- ios/Video/RCTVideo.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index 2b4a20dea7..d80e86c844 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -652,7 +652,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH if _controls { let viewController:UIViewController! = self.reactViewController() - viewController.addChild(_playerViewController) + viewController?.addChild(_playerViewController) self.addSubview(_playerViewController.view) }