From f519f0182c733fb63c86bda8cb236dc3172caf40 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Thu, 30 Apr 2015 11:50:39 +0200 Subject: [PATCH] Bug 1160098 - XULElement::LoadSrc() should check whether we successfully created a new frameLoader before trying to call SetIsPrerendered() on it r=smaug --- dom/xul/nsXULElement.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/xul/nsXULElement.cpp b/dom/xul/nsXULElement.cpp index 7d8d24c8bb48..f54bef3bd604 100644 --- a/dom/xul/nsXULElement.cpp +++ b/dom/xul/nsXULElement.cpp @@ -1599,13 +1599,13 @@ nsXULElement::LoadSrc() // Usually xul elements are used in chrome, which doesn't have // session history at all. slots->mFrameLoader = nsFrameLoader::Create(this, false); + NS_ENSURE_TRUE(slots->mFrameLoader, NS_OK); + if (AttrValueIs(kNameSpaceID_None, nsGkAtoms::prerendered, NS_LITERAL_STRING("true"), eIgnoreCase)) { nsresult rv = slots->mFrameLoader->SetIsPrerendered(); NS_ENSURE_SUCCESS(rv,rv); } - - NS_ENSURE_TRUE(slots->mFrameLoader, NS_OK); } return slots->mFrameLoader->LoadFrame();