Only warn in debug builds, and don't assert on user defined actions. bug 153783, r+sr=jst
git-svn-id: svn://10.0.0.236/trunk@190784 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2366,14 +2366,14 @@ nsDocShell::GetChildAt(PRInt32 aIndex, nsIDocShellTreeItem ** aChild)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aChild);
|
||||
|
||||
NS_WARN_IF_FALSE(aIndex >=0 && aIndex < mChildList.Count(),
|
||||
"index of child element is out of range!");
|
||||
#ifdef DEBUG
|
||||
if (aIndex < 0) {
|
||||
printf("Don't be so negative!");
|
||||
NS_WARNING("Negative index passed to GetChildAt");
|
||||
}
|
||||
else if (aIndex >= mChildList.Count()) {
|
||||
printf("Don't be so unrealistic!");
|
||||
NS_WARNING("Too large an index passed to GetChildAt");
|
||||
}
|
||||
#endif
|
||||
|
||||
nsIDocumentLoader* child = SafeChildAt(aIndex);
|
||||
NS_ENSURE_TRUE(child, NS_ERROR_UNEXPECTED);
|
||||
|
||||
Reference in New Issue
Block a user