mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-30 20:48:52 +00:00
Bug 116413: Use SafeElementAt for Mac nsMenuStack::GetMenuAt/HaveMenuAt.
sr=jst, no r= needed as per jst
This commit is contained in:
parent
d579c42217
commit
0f238b249b
@ -100,7 +100,8 @@ nsMenuStack::~nsMenuStack()
|
||||
nsresult
|
||||
nsMenuStack::GetMenuAt(PRInt32 aIndex, nsIMenu **outMenu)
|
||||
{
|
||||
nsCOMPtr<nsISupports> elementPtr = getter_AddRefs(mMenuArray.ElementAt(aIndex));
|
||||
// I'd prefer to fix the caller, but this will be safe
|
||||
nsCOMPtr<nsISupports> elementPtr = getter_AddRefs(mMenuArray.SafeElementAt(aIndex));
|
||||
if (!elementPtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
@ -111,7 +112,8 @@ nsMenuStack::GetMenuAt(PRInt32 aIndex, nsIMenu **outMenu)
|
||||
PRBool
|
||||
nsMenuStack::HaveMenuAt(PRInt32 aIndex)
|
||||
{
|
||||
nsCOMPtr<nsISupports> elementPtr = getter_AddRefs(mMenuArray.ElementAt(aIndex));
|
||||
// I'd prefer to fix the caller, but this will be safe
|
||||
nsCOMPtr<nsISupports> elementPtr = getter_AddRefs(mMenuArray.SafeElementAt(aIndex));
|
||||
if (!elementPtr)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user