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:
parent
07fbfbf65d
commit
60a0a830ca
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user