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
Родитель 0e646d9b81
Коммит e6f4350ea9
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

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