|
@@ -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]];
|