ソースを参照

fix(iOS): file picker crash (#1567)

* fix(iOS): Consider UIImagePickerController or similar controllers that are no longer beingPresented when acquiring the TopViewController; this prevents the crash of throwing an alert on a ViewController which is no longer in the window hierarchy

* fix(iOS): correcting import to src from lib

* fix(iOS): reverting import modification

Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu>
jxm2004 4 年 前
コミット
05c1d8f264
No account linked to committer's email address
共有1 個のファイルを変更した1 個の追加1 個の削除を含む
  1. 1
    1
      apple/RNCWebView.m

+ 1
- 1
apple/RNCWebView.m ファイルの表示

@@ -878,7 +878,7 @@ static NSDictionary* customCertificatesForHost;
878 878
  */
879 879
 -(UIViewController *)topViewControllerWithRootViewController:(UIViewController *)viewController{
880 880
   if (viewController==nil) return nil;
881
-  if (viewController.presentedViewController!=nil) {
881
+  if (viewController.presentedViewController!=nil && viewController.presentedViewController.isBeingPresented) {
882 882
     return [self topViewControllerWithRootViewController:viewController.presentedViewController];
883 883
   } else if ([viewController isKindOfClass:[UITabBarController class]]){
884 884
     return [self topViewControllerWithRootViewController:[(UITabBarController *)viewController selectedViewController]];