mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 12470. Check for null pointer in SetParent(); occurs during teardown.
This commit is contained in:
parent
a079c6ff90
commit
7b7f065d98
@ -1664,7 +1664,7 @@ RDFElementImpl::SetParent(nsIContent* aParent)
|
||||
|
||||
// If we're an observes node, then we need to add our parent element
|
||||
// as a broadcast listener.
|
||||
if (tagName && tagName.get() == kObservesAtom) {
|
||||
if (mDocument && tagName && tagName.get() == kObservesAtom) {
|
||||
// Find the node that we're supposed to be
|
||||
// observing and perform the hookup.
|
||||
nsAutoString elementValue;
|
||||
@ -1677,6 +1677,10 @@ RDFElementImpl::SetParent(nsIContent* aParent)
|
||||
attributeValue);
|
||||
|
||||
nsCOMPtr<nsIDOMXULDocument> xulDocument( do_QueryInterface(mDocument) );
|
||||
NS_ASSERTION(xulDocument != nsnull, "not in a XUL document");
|
||||
if (! xulDocument)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
nsCOMPtr<nsIDOMElement> domElement;
|
||||
xulDocument->GetElementById(elementValue, getter_AddRefs(domElement));
|
||||
|
||||
|
@ -1664,7 +1664,7 @@ RDFElementImpl::SetParent(nsIContent* aParent)
|
||||
|
||||
// If we're an observes node, then we need to add our parent element
|
||||
// as a broadcast listener.
|
||||
if (tagName && tagName.get() == kObservesAtom) {
|
||||
if (mDocument && tagName && tagName.get() == kObservesAtom) {
|
||||
// Find the node that we're supposed to be
|
||||
// observing and perform the hookup.
|
||||
nsAutoString elementValue;
|
||||
@ -1677,6 +1677,10 @@ RDFElementImpl::SetParent(nsIContent* aParent)
|
||||
attributeValue);
|
||||
|
||||
nsCOMPtr<nsIDOMXULDocument> xulDocument( do_QueryInterface(mDocument) );
|
||||
NS_ASSERTION(xulDocument != nsnull, "not in a XUL document");
|
||||
if (! xulDocument)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
nsCOMPtr<nsIDOMElement> domElement;
|
||||
xulDocument->GetElementById(elementValue, getter_AddRefs(domElement));
|
||||
|
||||
|
@ -1664,7 +1664,7 @@ RDFElementImpl::SetParent(nsIContent* aParent)
|
||||
|
||||
// If we're an observes node, then we need to add our parent element
|
||||
// as a broadcast listener.
|
||||
if (tagName && tagName.get() == kObservesAtom) {
|
||||
if (mDocument && tagName && tagName.get() == kObservesAtom) {
|
||||
// Find the node that we're supposed to be
|
||||
// observing and perform the hookup.
|
||||
nsAutoString elementValue;
|
||||
@ -1677,6 +1677,10 @@ RDFElementImpl::SetParent(nsIContent* aParent)
|
||||
attributeValue);
|
||||
|
||||
nsCOMPtr<nsIDOMXULDocument> xulDocument( do_QueryInterface(mDocument) );
|
||||
NS_ASSERTION(xulDocument != nsnull, "not in a XUL document");
|
||||
if (! xulDocument)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
nsCOMPtr<nsIDOMElement> domElement;
|
||||
xulDocument->GetElementById(elementValue, getter_AddRefs(domElement));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user