зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
83e6cf434d
Коммит
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче