mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
reviewed by hyatt bug of someone elses but in my code. dont know number. simple check for null
This commit is contained in:
parent
21ff71f017
commit
f503e16496
@ -446,7 +446,7 @@ nsresult nsContentIterator::GetNextSibling(nsCOMPtr<nsIContent> aNode, nsCOMPtr<
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
PRInt32 indx;
|
||||
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))))
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))) || !parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (NS_FAILED(parent->IndexOf(aNode, indx)))
|
||||
@ -480,7 +480,7 @@ nsresult nsContentIterator::GetPrevSibling(nsCOMPtr<nsIContent> aNode, nsCOMPtr<
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
PRInt32 indx;
|
||||
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))))
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))) || !parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (NS_FAILED(parent->IndexOf(aNode, indx)))
|
||||
@ -537,7 +537,7 @@ nsresult nsContentIterator::NextNode(nsCOMPtr<nsIContent> *ioNextNode)
|
||||
PRInt32 indx;
|
||||
|
||||
// get next sibling if there is one
|
||||
if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))))
|
||||
if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))) || !parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (!parent || NS_FAILED(parent->IndexOf(cN, indx)))
|
||||
{
|
||||
@ -571,7 +571,7 @@ nsresult nsContentIterator::PrevNode(nsCOMPtr<nsIContent> *ioNextNode)
|
||||
PRInt32 indx;
|
||||
|
||||
// get prev sibling if there is one
|
||||
if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))))
|
||||
if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))) || !parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (!parent || NS_FAILED(parent->IndexOf(cN, indx)))
|
||||
{
|
||||
@ -1067,7 +1067,7 @@ nsresult nsContentSubtreeIterator::GetTopAncestorInRange(
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
while (aNode)
|
||||
{
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))))
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))) || !parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (NS_FAILED(CompareNodeToRange(parent, mRange, &nodeBefore, &nodeAfter)))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -446,7 +446,7 @@ nsresult nsContentIterator::GetNextSibling(nsCOMPtr<nsIContent> aNode, nsCOMPtr<
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
PRInt32 indx;
|
||||
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))))
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))) || !parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (NS_FAILED(parent->IndexOf(aNode, indx)))
|
||||
@ -480,7 +480,7 @@ nsresult nsContentIterator::GetPrevSibling(nsCOMPtr<nsIContent> aNode, nsCOMPtr<
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
PRInt32 indx;
|
||||
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))))
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))) || !parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (NS_FAILED(parent->IndexOf(aNode, indx)))
|
||||
@ -537,7 +537,7 @@ nsresult nsContentIterator::NextNode(nsCOMPtr<nsIContent> *ioNextNode)
|
||||
PRInt32 indx;
|
||||
|
||||
// get next sibling if there is one
|
||||
if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))))
|
||||
if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))) || !parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (!parent || NS_FAILED(parent->IndexOf(cN, indx)))
|
||||
{
|
||||
@ -571,7 +571,7 @@ nsresult nsContentIterator::PrevNode(nsCOMPtr<nsIContent> *ioNextNode)
|
||||
PRInt32 indx;
|
||||
|
||||
// get prev sibling if there is one
|
||||
if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))))
|
||||
if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))) || !parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (!parent || NS_FAILED(parent->IndexOf(cN, indx)))
|
||||
{
|
||||
@ -1067,7 +1067,7 @@ nsresult nsContentSubtreeIterator::GetTopAncestorInRange(
|
||||
nsCOMPtr<nsIContent> parent;
|
||||
while (aNode)
|
||||
{
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))))
|
||||
if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))) || !parent)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (NS_FAILED(CompareNodeToRange(parent, mRange, &nodeBefore, &nodeAfter)))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
Loading…
Reference in New Issue
Block a user