Fix crash from GetElementsByTagName on a document without a root element. Patch from ftang@netscape.com r=jst@netscape.com,dbaron@fas.harvard.edu sr=vidur@netscape.com b=40121

git-svn-id: svn://10.0.0.236/trunk@82008 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu 2000-10-30 18:51:50 +00:00
parent 07fbfbf65d
commit 60a0a830ca
2 changed files with 8 additions and 4 deletions

View File

@ -489,8 +489,10 @@ nsContentList::PopulateSelf()
else if (nsnull != mDocument) {
nsIContent *root;
root = mDocument->GetRootContent();
PopulateWith(root, PR_TRUE);
NS_RELEASE(root);
if (root) {
PopulateWith(root, PR_TRUE);
NS_RELEASE(root);
}
}
}

View File

@ -489,8 +489,10 @@ nsContentList::PopulateSelf()
else if (nsnull != mDocument) {
nsIContent *root;
root = mDocument->GetRootContent();
PopulateWith(root, PR_TRUE);
NS_RELEASE(root);
if (root) {
PopulateWith(root, PR_TRUE);
NS_RELEASE(root);
}
}
}