Skip to content

Commit deb3588

Browse files
authored
Update RNFetchBlob.m
Solved an issue where the rootNavigationController is not necessarily the currently displayed controller, which caused an error of: Warning: Attempt to present <SecondViewController: 0x7fb54b523240> on <ViewController: 0x7fb54b61e7f0> whose view is not in the window hierarchy!
1 parent 44add8c commit deb3588

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ios/RNFetchBlob/RNFetchBlob.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,12 @@ - (NSDictionary *)constantsToExport
622622
- (UIViewController *) documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller
623623
{
624624
UIWindow *window = [UIApplication sharedApplication].keyWindow;
625-
return window.rootViewController;
625+
UIViewController *currentlyPresentedView = [window.rootViewController presentedViewController];
626+
if (currentlyPresentedView == nil)
627+
{
628+
return window.rootViewController;
629+
}
630+
return currentlyPresentedView;
626631
}
627632

628633
# pragma mark - check expired network events

0 commit comments

Comments
 (0)