diff --git a/content/xbl/src/nsXBLBinding.cpp b/content/xbl/src/nsXBLBinding.cpp index 3b1be55fe6f2..a97a23523e1a 100644 --- a/content/xbl/src/nsXBLBinding.cpp +++ b/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/layout/xbl/src/nsXBLBinding.cpp b/layout/xbl/src/nsXBLBinding.cpp index 3b1be55fe6f2..a97a23523e1a 100644 --- a/layout/xbl/src/nsXBLBinding.cpp +++ b/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 + } } } }