From 823caae47bc28f9791d6b15e44ecd14d65e7799f Mon Sep 17 00:00:00 2001 From: "rjesup%wgate.com" Date: Sat, 22 Dec 2001 01:20:26 +0000 Subject: [PATCH] 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 --- mozilla/widget/src/mac/nsDynamicMDEF.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mozilla/widget/src/mac/nsDynamicMDEF.cpp b/mozilla/widget/src/mac/nsDynamicMDEF.cpp index 8f6f295a219..a2fd01dcaa9 100644 --- a/mozilla/widget/src/mac/nsDynamicMDEF.cpp +++ b/mozilla/widget/src/mac/nsDynamicMDEF.cpp @@ -100,7 +100,8 @@ nsMenuStack::~nsMenuStack() nsresult nsMenuStack::GetMenuAt(PRInt32 aIndex, nsIMenu **outMenu) { - nsCOMPtr elementPtr = getter_AddRefs(mMenuArray.ElementAt(aIndex)); + // I'd prefer to fix the caller, but this will be safe + nsCOMPtr 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 elementPtr = getter_AddRefs(mMenuArray.ElementAt(aIndex)); + // I'd prefer to fix the caller, but this will be safe + nsCOMPtr elementPtr = getter_AddRefs(mMenuArray.SafeElementAt(aIndex)); if (!elementPtr) return NS_ERROR_NULL_POINTER;