Bug 29148. Initialize out-params to sane values before returning an error. There are lots of places that don't check return codes on these methods. r=rjc, a=jar.
git-svn-id: svn://10.0.0.236/trunk@62170 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
fa156ab99b
commit
2e936b1a00
@ -2143,8 +2143,10 @@ NS_IMETHODIMP
|
||||
nsXULElement::ChildCount(PRInt32& aResult) const
|
||||
{
|
||||
nsresult rv;
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated()))
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated())) {
|
||||
aResult = 0;
|
||||
return rv;
|
||||
}
|
||||
|
||||
return PeekChildCount(aResult);
|
||||
}
|
||||
@ -2153,8 +2155,10 @@ NS_IMETHODIMP
|
||||
nsXULElement::ChildAt(PRInt32 aIndex, nsIContent*& aResult) const
|
||||
{
|
||||
nsresult rv;
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated()))
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated())) {
|
||||
aResult = nsnull;
|
||||
return rv;
|
||||
}
|
||||
|
||||
aResult = nsnull;
|
||||
if (! mChildren)
|
||||
@ -2176,8 +2180,10 @@ NS_IMETHODIMP
|
||||
nsXULElement::IndexOf(nsIContent* aPossibleChild, PRInt32& aResult) const
|
||||
{
|
||||
nsresult rv;
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated()))
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated())) {
|
||||
aResult = -1;
|
||||
return rv;
|
||||
}
|
||||
|
||||
aResult = (mChildren) ? (mChildren->IndexOf(aPossibleChild)) : (-1);
|
||||
return NS_OK;
|
||||
|
||||
@ -2143,8 +2143,10 @@ NS_IMETHODIMP
|
||||
nsXULElement::ChildCount(PRInt32& aResult) const
|
||||
{
|
||||
nsresult rv;
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated()))
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated())) {
|
||||
aResult = 0;
|
||||
return rv;
|
||||
}
|
||||
|
||||
return PeekChildCount(aResult);
|
||||
}
|
||||
@ -2153,8 +2155,10 @@ NS_IMETHODIMP
|
||||
nsXULElement::ChildAt(PRInt32 aIndex, nsIContent*& aResult) const
|
||||
{
|
||||
nsresult rv;
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated()))
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated())) {
|
||||
aResult = nsnull;
|
||||
return rv;
|
||||
}
|
||||
|
||||
aResult = nsnull;
|
||||
if (! mChildren)
|
||||
@ -2176,8 +2180,10 @@ NS_IMETHODIMP
|
||||
nsXULElement::IndexOf(nsIContent* aPossibleChild, PRInt32& aResult) const
|
||||
{
|
||||
nsresult rv;
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated()))
|
||||
if (NS_FAILED(rv = EnsureContentsGenerated())) {
|
||||
aResult = -1;
|
||||
return rv;
|
||||
}
|
||||
|
||||
aResult = (mChildren) ? (mChildren->IndexOf(aPossibleChild)) : (-1);
|
||||
return NS_OK;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user