Bug 1637888 - Add a null-check for Document passed to `PreloaderBase::NotifyRestart` as it is a valid case to happen, r=emilio
authorHonza Bambas <honzab.moz@firemni.cz>
Thu, 14 May 2020 11:24:03 +0000
changeset 593607 ce86fc54910a501d9d6f961eb4467decb297e5d9
parent 593606 5889105bd08941784888442e638829a2561f900c
child 593608 c6808d59644cf49ca9e1f97815b616e18af33d71
push id13186
push userffxbld-merge
push dateMon, 01 Jun 2020 09:52:46 +0000
treeherdermozilla-beta@3e7c70a1e4a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1637888
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1637888 - Add a null-check for Document passed to `PreloaderBase::NotifyRestart` as it is a valid case to happen, r=emilio Differential Revision: https://phabricator.services.mozilla.com/D75282
uriloader/preload/PreloaderBase.cpp
--- a/uriloader/preload/PreloaderBase.cpp
+++ b/uriloader/preload/PreloaderBase.cpp
@@ -141,17 +141,20 @@ void PreloaderBase::NotifyUsage() {
 
   mIsUsed = true;
 
   // * Cancel the usage timer.
 }
 
 void PreloaderBase::NotifyRestart(dom::Document* aDocument,
                                   PreloaderBase* aNewPreloader) {
-  aDocument->Preloads().DeregisterPreload(&mKey);
+  if (aDocument) {
+    aDocument->Preloads().DeregisterPreload(&mKey);
+  }
+
   mKey = PreloadHashKey();
 
   if (aNewPreloader) {
     aNewPreloader->mNodes = std::move(mNodes);
   }
 }
 
 void PreloaderBase::NotifyStart(nsIRequest* aRequest) {