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:
cbiesinger%web.de 2006-12-17 21:59:26 +00:00
parent fe85f89a4d
commit 189a0004b8

View File

@ -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);
}