Bug 374021 - Loading an overlay using loadOverlay into an uninitialized XULDocument r?mystor draft
authorJean-Luc Bonnafoux <jeanluc.bonnafoux@wanadoo.fr>
Sat, 03 Mar 2018 20:39:13 +0100
changeset 762889 8bc31085c68fac6d9bdb084fa1a455419850e0fd
parent 759514 cfadc5861d959cd16e5485625c7bfb8d992e0727
push id101283
push userbmo:jeanluc.bonnafoux@wanadoo.fr
push dateSat, 03 Mar 2018 19:43:18 +0000
reviewersmystor
bugs374021
milestone59.0a1
Bug 374021 - Loading an overlay using loadOverlay into an uninitialized XULDocument r?mystor MozReview-Commit-ID: 8fMuzfF5JnT
dom/xul/XULDocument.cpp
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -2222,17 +2222,18 @@ XULDocument::LoadOverlayInternal(nsIURI*
     if (aIsDynamic)
         mResolutionPhase = nsForwardReference::eStart;
 
     // Look in the prototype cache for the prototype document with
     // the specified overlay URI. Only use the cache if the containing
     // document is chrome otherwise it may not have a system principal and
     // the cached document will, see bug 565610.
     bool overlayIsChrome = IsChromeURI(aURI);
-    bool documentIsChrome = IsChromeURI(mDocumentURI);
+    bool documentIsChrome = mDocumentURI ?
+        IsChromeURI(mDocumentURI) : false;
     mCurrentPrototype = overlayIsChrome && documentIsChrome ?
         nsXULPrototypeCache::GetInstance()->GetPrototype(aURI) : nullptr;
 
     // Same comment as nsChromeProtocolHandler::NewChannel and
     // XULDocument::StartDocumentLoad
     // - Ben Goodger
     //
     // We don't abort on failure here because there are too many valid