REGRESSION(r235489): fast/dom/navigator-detached-no-crash.html crashes under Navigato...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2018 21:33:38 +0000 (21:33 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2018 21:33:38 +0000 (21:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189170

Patch by Olivia Barnett <obarnett@apple.com> on 2018-08-30
Reviewed by Tim Horton.

No new tests; fixing a failing existing test.

* page/Navigator.cpp:
(WebCore::Navigator::share):
Added null check for frame.

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

Source/WebCore/ChangeLog
Source/WebCore/page/Navigator.cpp

index 399eb49..a5427ec 100644 (file)
@@ -1,3 +1,16 @@
+2018-08-30  Olivia Barnett  <obarnett@apple.com>
+
+        REGRESSION(r235489): fast/dom/navigator-detached-no-crash.html crashes under Navigator::share
+        https://bugs.webkit.org/show_bug.cgi?id=189170
+
+        Reviewed by Tim Horton.
+
+        No new tests; fixing a failing existing test.
+
+        * page/Navigator.cpp:
+        (WebCore::Navigator::share):
+        Added null check for frame.
+
 2018-08-30  Truitt Savell  <tsavell@apple.com>
 
         Unreviewed, rolling out r235516.
index 2aef7a9..7569ca8 100644 (file)
@@ -99,7 +99,7 @@ bool Navigator::onLine() const
 
 void Navigator::share(ScriptExecutionContext& context, ShareData data, Ref<DeferredPromise>&& promise)
 {
-    if (!m_frame->page()) {
+    if (!m_frame || !m_frame->page()) {
         promise->reject(TypeError);
         return;
     }