don't crash when there is bad XML

This commit is contained in:
alecf%netscape.com 2000-04-30 19:21:20 +00:00
parent 9a23850613
commit d7ad51a9fd
2 changed files with 14 additions and 10 deletions

View File

@ -948,12 +948,14 @@ nsXBLBinding::GetBaseTag(nsIAtom** aResult)
if (xmlContent) {
xmlContent->GetContainingNameSpace(*getter_AddRefs(nameSpace));
nsCOMPtr<nsINameSpace> tagSpace;
nameSpace->FindNameSpace(prefixAtom, *getter_AddRefs(tagSpace));
if (tagSpace) {
// Score! Return the tag.
if (nameSpace) {
nsCOMPtr<nsINameSpace> tagSpace;
nameSpace->FindNameSpace(prefixAtom, *getter_AddRefs(tagSpace));
if (tagSpace) {
// Score! Return the tag.
// XXX We should really return the namespace as well.
*aResult = NS_NewAtom(extends); // The addref happens here
*aResult = NS_NewAtom(extends); // The addref happens here
}
}
}
}

View File

@ -948,12 +948,14 @@ nsXBLBinding::GetBaseTag(nsIAtom** aResult)
if (xmlContent) {
xmlContent->GetContainingNameSpace(*getter_AddRefs(nameSpace));
nsCOMPtr<nsINameSpace> tagSpace;
nameSpace->FindNameSpace(prefixAtom, *getter_AddRefs(tagSpace));
if (tagSpace) {
// Score! Return the tag.
if (nameSpace) {
nsCOMPtr<nsINameSpace> tagSpace;
nameSpace->FindNameSpace(prefixAtom, *getter_AddRefs(tagSpace));
if (tagSpace) {
// Score! Return the tag.
// XXX We should really return the namespace as well.
*aResult = NS_NewAtom(extends); // The addref happens here
*aResult = NS_NewAtom(extends); // The addref happens here
}
}
}
}