mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
bug 275116 use the safe version of ObjectAt as required by the documentation
patch by Andreas Lange <mozilla@lange.cx> r=darin sr=biesi
This commit is contained in:
parent
fe85f89a4d
commit
189a0004b8
@ -70,11 +70,11 @@ nsArray::QueryElementAt(PRUint32 aIndex,
|
||||
const nsIID& aIID,
|
||||
void ** aResult)
|
||||
{
|
||||
nsISupports * obj = mArray.ObjectAt(aIndex);
|
||||
if (!obj) return NS_ERROR_UNEXPECTED;
|
||||
nsISupports * obj = mArray.SafeObjectAt(aIndex);
|
||||
if (!obj) return NS_ERROR_ILLEGAL_VALUE;
|
||||
|
||||
// no need to worry about a leak here, because ObjectAt() doesn't
|
||||
// addref its result
|
||||
// no need to worry about a leak here, because SafeObjectAt()
|
||||
// doesn't addref its result
|
||||
return obj->QueryInterface(aIID, aResult);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user