Skip to content

Commit 608e73b

Browse files
author
bzbarsky%mit.edu
committed
nsCOMArray::RemoveObjectAt fails to remove nulls correctly. Bug 265772,
r=darin, sr=dbaron
1 parent 55c0328 commit 608e73b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

xpcom/ds/nsCOMArray.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,10 @@ PRBool
135135
nsCOMArray_base::RemoveObjectAt(PRInt32 aIndex)
136136
{
137137
nsISupports* element = ObjectAt(aIndex);
138-
if (element) {
139-
PRBool result = mArray.RemoveElementAt(aIndex);
140-
if (result)
141-
NS_IF_RELEASE(element);
142-
return result;
143-
}
144-
return PR_FALSE;
138+
PRBool result = mArray.RemoveElementAt(aIndex);
139+
if (result)
140+
NS_IF_RELEASE(element);
141+
return result;
145142
}
146143

147144
// useful for destructors

0 commit comments

Comments
 (0)