Fix for bug #9891: added NULL pointer check in ContentInserted()

This commit is contained in:
troy%netscape.com 1999-07-16 02:14:26 +00:00
parent 51fc2a157a
commit b9d0bec0ea
2 changed files with 4 additions and 2 deletions

View File

@ -4027,6 +4027,7 @@ nsCSSFrameConstructor::GetFloaterContainingBlock(nsIPresContext* aPresContext,
static inline PRBool
IsGeneratedContentFor(nsIContent* aContent, nsIFrame* aFrame)
{
NS_PRECONDITION(aFrame, "null frame pointer");
nsFrameState state;
PRBool result = PR_FALSE;
@ -4375,7 +4376,7 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
nsIFrame* firstChild;
parentFrame->FirstChild(nsnull, &firstChild);
if (IsGeneratedContentFor(aContainer, firstChild)) {
if (firstChild && IsGeneratedContentFor(aContainer, firstChild)) {
// Insert the new frames after the :before pseudo-element
prevSibling = firstChild;
}

View File

@ -4027,6 +4027,7 @@ nsCSSFrameConstructor::GetFloaterContainingBlock(nsIPresContext* aPresContext,
static inline PRBool
IsGeneratedContentFor(nsIContent* aContent, nsIFrame* aFrame)
{
NS_PRECONDITION(aFrame, "null frame pointer");
nsFrameState state;
PRBool result = PR_FALSE;
@ -4375,7 +4376,7 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
nsIFrame* firstChild;
parentFrame->FirstChild(nsnull, &firstChild);
if (IsGeneratedContentFor(aContainer, firstChild)) {
if (firstChild && IsGeneratedContentFor(aContainer, firstChild)) {
// Insert the new frames after the :before pseudo-element
prevSibling = firstChild;
}