Make sure we have a frame before trying to access its loader
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2019 01:42:44 +0000 (01:42 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2019 01:42:44 +0000 (01:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193985
<rdar://problem/47618239>

Reviewed by Ryosuke Niwa.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):

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

Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadObserver.cpp

index 1534bcd..6f8ab91 100644 (file)
@@ -1,3 +1,14 @@
+2019-01-29  Brent Fulgham  <bfulgham@apple.com>
+
+        Make sure we have a frame before trying to access its loader 
+        https://bugs.webkit.org/show_bug.cgi?id=193985
+        <rdar://problem/47618239>
+
+        Reviewed by Ryosuke Niwa.
+
+        * loader/ResourceLoadObserver.cpp:
+        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
+
 2019-01-29  Andy Estes  <aestes@apple.com>
 
         Try to fix the watchOS build.
index 01d33d6..a363155 100644 (file)
@@ -214,11 +214,12 @@ void ResourceLoadObserver::logUserInteractionWithReducedTimeResolution(const Doc
     statistics.mostRecentUserInteractionTime = newTime;
 
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    if (auto* opener = document.frame()->loader().opener()) {
-        if (auto* openerDocument = opener->document()) {
-            if (auto* openerFrame = openerDocument->frame()) {
-                if (auto openerPageID = openerFrame->loader().client().pageID()) {
-                    requestStorageAccessUnderOpener(domain, openerPageID.value(), *openerDocument);
+    if (auto* frame = document.frame()) {
+        if (auto* opener = frame->loader().opener()) {
+            if (auto* openerDocument = opener->document()) {
+                if (auto* openerFrame = openerDocument->frame()) {
+                    if (auto openerPageID = openerFrame->loader().client().pageID())
+                        requestStorageAccessUnderOpener(domain, openerPageID.value(), *openerDocument);
                 }
             }
         }