diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index f51e015da13a..838324fc0126 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -1779,7 +1779,10 @@ FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent) { nsIContent* frameContent; PRBool hasSameContent; - + + NS_ASSERTION(aFrame, "No frame to search!"); + if (!aFrame) return nsnull; + // See if the frame points to the same content object aFrame->GetContent(&frameContent); hasSameContent = (frameContent == aContent); diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp index f51e015da13a..838324fc0126 100644 --- a/layout/html/base/src/nsPresShell.cpp +++ b/layout/html/base/src/nsPresShell.cpp @@ -1779,7 +1779,10 @@ FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent) { nsIContent* frameContent; PRBool hasSameContent; - + + NS_ASSERTION(aFrame, "No frame to search!"); + if (!aFrame) return nsnull; + // See if the frame points to the same content object aFrame->GetContent(&frameContent); hasSameContent = (frameContent == aContent);