add try catch block around removal of observer keypaths on playerViewController

This commit is contained in:
Ash Mishra 2019-11-19 12:47:15 -08:00
parent a5bfba9451
commit fa20965c35

View File

@ -1381,8 +1381,11 @@ static int const RCTVideoUnset = -1;
{ {
if (_playerViewController == playerViewController && _fullscreenPlayerPresented && self.onVideoFullscreenPlayerWillDismiss) if (_playerViewController == playerViewController && _fullscreenPlayerPresented && self.onVideoFullscreenPlayerWillDismiss)
{ {
[_playerViewController.contentOverlayView removeObserver:self forKeyPath:@"frame"]; @try{
[_playerViewController removeObserver:self forKeyPath:readyForDisplayKeyPath]; [_playerViewController.contentOverlayView removeObserver:self forKeyPath:@"frame"];
[_playerViewController removeObserver:self forKeyPath:readyForDisplayKeyPath];
}@catch(id anException){
}
self.onVideoFullscreenPlayerWillDismiss(@{@"target": self.reactTag}); self.onVideoFullscreenPlayerWillDismiss(@{@"target": self.reactTag});
} }
} }