mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-31 02:48:48 +00:00
Don't assert & crash when trying to get child docshells that are out of bounds. b=127528 r=ccarlen@netscape.com sr=jst@netscape.com a=asa@mozilla.org
This commit is contained in:
parent
83e6cf434d
commit
1399126d90
@ -2029,8 +2029,8 @@ nsDocShell::GetChildAt(PRInt32 aIndex, nsIDocShellTreeItem ** aChild)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aChild);
|
||||
|
||||
NS_ASSERTION(aIndex >= 0 && aIndex < mChildren.Count(),"Bad docshell ChildAt index");
|
||||
*aChild = (nsIDocShellTreeItem *) mChildren.ElementAt(aIndex);
|
||||
NS_WARN_IF_FALSE(aIndex >=0 && aIndex < mChildren.Count(), "index of child element is out of range!");
|
||||
*aChild = (nsIDocShellTreeItem *) mChildren.SafeElementAt(aIndex);
|
||||
NS_IF_ADDREF(*aChild);
|
||||
|
||||
return NS_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user