[iOS] Crash at -[UIViewController _presentViewController:withAnimationController...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2018 00:39:03 +0000 (00:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2018 00:39:03 +0000 (00:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188537
<rdar://problem/41400259>

Patch by James Savage <james.savage@apple.com> on 2018-08-13
Reviewed by Tim Horton.

* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::show): Avoid hitting a UIKit exception for
presenting an already presented view controller by turning the scenario
into an early return.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234831 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/ios/ValidationBubbleIOS.mm

index 6c06317..a9f396d 100644 (file)
@@ -1,3 +1,16 @@
+2018-08-13  James Savage  <james.savage@apple.com>
+
+        [iOS] Crash at -[UIViewController _presentViewController:withAnimationController:completion:]
+        https://bugs.webkit.org/show_bug.cgi?id=188537
+        <rdar://problem/41400259>
+
+        Reviewed by Tim Horton.
+
+        * platform/ios/ValidationBubbleIOS.mm:
+        (WebCore::ValidationBubble::show): Avoid hitting a UIKit exception for
+        presenting an already presented view controller by turning the scenario
+        into an early return.
+
 2018-08-13  Alex Christensen  <achristensen@webkit.org>
 
         Make CSSSelectorList a little more sane
index 3978fe0..ca010a3 100644 (file)
@@ -135,6 +135,9 @@ ValidationBubble::~ValidationBubble()
 
 void ValidationBubble::show()
 {
+    if ([m_popoverController parentViewController] || [m_popoverController presentingViewController])
+        return;
+
     // Protect the validation bubble so it stays alive until it is effectively presented. UIKit does not deal nicely with
     // dismissing a popover that is being presented.
     RefPtr<ValidationBubble> protectedThis(this);