SOAuthorizationSession::presentViewController should check WebPageProxy::isClosed()
https://bugs.webkit.org/show_bug.cgi?id=199755
<rdar://problem/52323585>
Reviewed by Chris Dumez.
WebPageProxy::pageClient() is not guaranteed to be non null all the time. Therefore, we should check
WebPageProxy::isClosed() before using it.
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
(WebKit::SOAuthorizationSession::presentViewController):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@247410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index cf8de6c..4959945 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2019-07-12 Jiewen Tan <jiewen_tan@apple.com>
+
+ SOAuthorizationSession::presentViewController should check WebPageProxy::isClosed()
+ https://bugs.webkit.org/show_bug.cgi?id=199755
+ <rdar://problem/52323585>
+
+ Reviewed by Chris Dumez.
+
+ WebPageProxy::pageClient() is not guaranteed to be non null all the time. Therefore, we should check
+ WebPageProxy::isClosed() before using it.
+
+ * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
+ (WebKit::SOAuthorizationSession::presentViewController):
+
2019-07-12 Chris Dumez <cdumez@apple.com>
Regression(macOS Catalina): Cannot quick look html documents in Mail
diff --git a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm
index c9892dd..bcdb0c2 100644
--- a/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm
+++ b/Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm
@@ -183,7 +183,7 @@
{
ASSERT(m_state == State::Active);
// Only expect at most one UI session for the whole authorization session.
- if (!m_page || m_viewController) {
+ if (!m_page || m_page->isClosed() || m_viewController) {
uiCallback(NO, adoptNS([[NSError alloc] initWithDomain:SOErrorDomain code:kSOErrorAuthorizationPresentationFailed userInfo:nil]).get());
return;
}