diff --git a/STPopup/UIViewController+STPopup.m b/STPopup/UIViewController+STPopup.m index b80a977..408e26a 100644 --- a/STPopup/UIViewController+STPopup.m +++ b/STPopup/UIViewController+STPopup.m @@ -64,7 +64,9 @@ - (void)st_viewDidLoad - (void)st_presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion { if (!self.popupController) { - [self st_presentViewController:viewControllerToPresent animated:flag completion:completion]; + if (viewControllerToPresent != nil) { + [self st_presentViewController:viewControllerToPresent animated:flag completion:completion]; + } return; } @@ -157,4 +159,4 @@ - (STPopupController *)popupController return popupController; } -@end \ No newline at end of file +@end