From fa20965c35da0715422f2b75e6f40af5e0c82957 Mon Sep 17 00:00:00 2001 From: Ash Mishra Date: Tue, 19 Nov 2019 12:47:15 -0800 Subject: [PATCH] add try catch block around removal of observer keypaths on playerViewController --- ios/Video/RCTVideo.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ios/Video/RCTVideo.m b/ios/Video/RCTVideo.m index efd48c70..113d9f23 100644 --- a/ios/Video/RCTVideo.m +++ b/ios/Video/RCTVideo.m @@ -1381,8 +1381,11 @@ static int const RCTVideoUnset = -1; { if (_playerViewController == playerViewController && _fullscreenPlayerPresented && self.onVideoFullscreenPlayerWillDismiss) { - [_playerViewController.contentOverlayView removeObserver:self forKeyPath:@"frame"]; - [_playerViewController removeObserver:self forKeyPath:readyForDisplayKeyPath]; + @try{ + [_playerViewController.contentOverlayView removeObserver:self forKeyPath:@"frame"]; + [_playerViewController removeObserver:self forKeyPath:readyForDisplayKeyPath]; + }@catch(id anException){ + } self.onVideoFullscreenPlayerWillDismiss(@{@"target": self.reactTag}); } }