Patch from alecf to do a null pointer check in FindFrameWithContent().

This commit is contained in:
nisheeth%netscape.com 1999-06-05 00:18:03 +00:00
Родитель 03e4921265
Коммит 6da324eafb
2 изменённых файлов: 8 добавлений и 2 удалений

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

@ -1780,6 +1780,9 @@ FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent)
nsIContent* frameContent; nsIContent* frameContent;
PRBool hasSameContent; PRBool hasSameContent;
NS_ASSERTION(aFrame, "No frame to search!");
if (!aFrame) return nsnull;
// See if the frame points to the same content object // See if the frame points to the same content object
aFrame->GetContent(&frameContent); aFrame->GetContent(&frameContent);
hasSameContent = (frameContent == aContent); hasSameContent = (frameContent == aContent);

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

@ -1780,6 +1780,9 @@ FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent)
nsIContent* frameContent; nsIContent* frameContent;
PRBool hasSameContent; PRBool hasSameContent;
NS_ASSERTION(aFrame, "No frame to search!");
if (!aFrame) return nsnull;
// See if the frame points to the same content object // See if the frame points to the same content object
aFrame->GetContent(&frameContent); aFrame->GetContent(&frameContent);
hasSameContent = (frameContent == aContent); hasSameContent = (frameContent == aContent);