diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index dc54c8b2c422..001db31d0280 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -5031,9 +5031,10 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsIPresShell* aPresShell, CreateAnonymousFrames(aPresShell, aPresContext, aTag, aState, aContent, newFrame, PR_FALSE, childItems); - // Set the frame's initial child list - newFrame->SetInitialChildList(aPresContext, nsnull, childItems.childList); + if (childItems.childList) { + newFrame->SetInitialChildList(aPresContext, nsnull, childItems.childList); + } } // If the frame is positioned, then create a placeholder frame diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index dc54c8b2c422..001db31d0280 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -5031,9 +5031,10 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsIPresShell* aPresShell, CreateAnonymousFrames(aPresShell, aPresContext, aTag, aState, aContent, newFrame, PR_FALSE, childItems); - // Set the frame's initial child list - newFrame->SetInitialChildList(aPresContext, nsnull, childItems.childList); + if (childItems.childList) { + newFrame->SetInitialChildList(aPresContext, nsnull, childItems.childList); + } } // If the frame is positioned, then create a placeholder frame