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
This commit is contained in:
Honza Bambas 2020-05-14 11:24:03 +00:00
parent bb85ae41b1
commit 3195caba81

View File

@ -146,7 +146,10 @@ void PreloaderBase::NotifyUsage() {
void PreloaderBase::NotifyRestart(dom::Document* aDocument,
PreloaderBase* aNewPreloader) {
aDocument->Preloads().DeregisterPreload(&mKey);
if (aDocument) {
aDocument->Preloads().DeregisterPreload(&mKey);
}
mKey = PreloadHashKey();
if (aNewPreloader) {