Don't assume mRootContent is non-null. Bug 340796, r=sicking, sr=neil, branch181=sicking

This commit is contained in:
bzbarsky%mit.edu 2006-06-15 03:13:00 +00:00
Родитель 90ce32e3d2
Коммит cd73f2108b
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -1351,7 +1351,8 @@ nsXULDocument::GetPixelDimensions(nsIPresShell* aShell, PRInt32* aWidth,
FlushPendingNotifications(Flush_Layout);
nsIFrame* frame = aShell->GetPrimaryFrameFor(mRootContent);
nsIFrame* frame =
mRootContent ? aShell->GetPrimaryFrameFor(mRootContent) : nsnull;
if (frame) {
nsIView* view = frame->GetView();
// If we have a view check if it's scrollable. If not,
@ -2867,7 +2868,10 @@ nsXULDocument::ResumeWalk()
mDocumentLoaded = PR_TRUE;
nsAutoString title;
mRootContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::title, title);
if (mRootContent) {
mRootContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::title,
title);
}
SetTitle(title);
StartLayout();
@ -3546,6 +3550,10 @@ nsXULDocument::OverlayForwardReference::Resolve()
mOverlay->GetAttr(kNameSpaceID_None, nsXULAtoms::id, id);
if (id.IsEmpty()) {
// overlay had no id, use the root element
if (!mDocument->mRootContent) {
return eResolve_Error;
}
mDocument->InsertElement(mDocument->mRootContent, mOverlay, notify);
mResolved = PR_TRUE;
return eResolve_Succeeded;