From fd6f01043d669ca532e59b2628b4e035aed55aad Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Sun, 30 Apr 2000 19:21:20 +0000 Subject: [PATCH] don't crash when there is bad XML git-svn-id: svn://10.0.0.236/trunk@67672 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/xbl/src/nsXBLBinding.cpp | 12 +++++++----- mozilla/layout/xbl/src/nsXBLBinding.cpp | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/mozilla/content/xbl/src/nsXBLBinding.cpp b/mozilla/content/xbl/src/nsXBLBinding.cpp index 3b1be55fe6f..a97a23523e1 100644 --- a/mozilla/content/xbl/src/nsXBLBinding.cpp +++ b/mozilla/content/xbl/src/nsXBLBinding.cpp @@ -948,12 +948,14 @@ nsXBLBinding::GetBaseTag(nsIAtom** aResult) if (xmlContent) { xmlContent->GetContainingNameSpace(*getter_AddRefs(nameSpace)); - nsCOMPtr tagSpace; - nameSpace->FindNameSpace(prefixAtom, *getter_AddRefs(tagSpace)); - if (tagSpace) { - // Score! Return the tag. + if (nameSpace) { + nsCOMPtr 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 + } } } } diff --git a/mozilla/layout/xbl/src/nsXBLBinding.cpp b/mozilla/layout/xbl/src/nsXBLBinding.cpp index 3b1be55fe6f..a97a23523e1 100644 --- a/mozilla/layout/xbl/src/nsXBLBinding.cpp +++ b/mozilla/layout/xbl/src/nsXBLBinding.cpp @@ -948,12 +948,14 @@ nsXBLBinding::GetBaseTag(nsIAtom** aResult) if (xmlContent) { xmlContent->GetContainingNameSpace(*getter_AddRefs(nameSpace)); - nsCOMPtr tagSpace; - nameSpace->FindNameSpace(prefixAtom, *getter_AddRefs(tagSpace)); - if (tagSpace) { - // Score! Return the tag. + if (nameSpace) { + nsCOMPtr 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 + } } } }