Resource Load Statistics: Check if the store exists before clearing it
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Mar 2017 16:54:41 +0000 (16:54 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Mar 2017 16:54:41 +0000 (16:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170324
<rdar://problem/31258505>

Reviewed by Brent Fulgham.

No new tests. Added a null check.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
    Added a null check.

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

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

index aa5b8a9..a78ee5b 100644 (file)
@@ -1,3 +1,17 @@
+2017-03-31  John Wilander  <wilander@apple.com>
+
+        Resource Load Statistics: Check if the store exists before clearing it
+        https://bugs.webkit.org/show_bug.cgi?id=170324
+        <rdar://problem/31258505>
+
+        Reviewed by Brent Fulgham.
+
+        No new tests. Added a null check.
+
+        * loader/ResourceLoadObserver.cpp:
+        (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
+            Added a null check.
+
 2017-03-31  Romain Bellessort  <romain.bellessort@crf.canon.fr>
 
         [Readable Streams API] Implement cloneArrayBuffer in WebCore
index 976d0b7..c82767a 100644 (file)
@@ -70,7 +70,8 @@ void ResourceLoadObserver::setStatisticsStore(Ref<ResourceLoadStatisticsStore>&&
 
 void ResourceLoadObserver::clearInMemoryAndPersistentStore()
 {
-    m_store->clearInMemoryAndPersistent();
+    if (m_store)
+        m_store->clearInMemoryAndPersistent();
 }
 
 void ResourceLoadObserver::clearInMemoryAndPersistentStore(std::chrono::system_clock::time_point modifiedSince)