Bug 374021 - Loading an overlay using loadOverlay into an uninitialized XULDocument r?mystor
MozReview-Commit-ID: 8fMuzfF5JnT
--- 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