Bug 116413: Use SafeElementAt for Mac nsMenuStack::GetMenuAt/HaveMenuAt.

sr=jst, no r= needed as per jst


git-svn-id: svn://10.0.0.236/trunk@111025 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rjesup%wgate.com
2001-12-22 01:20:26 +00:00
parent d944856636
commit 823caae47b

View File

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