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:
mrbkap%gmail.com
2006-02-22 02:28:04 +00:00
parent 421f510e9a
commit 424bc2e551

View File

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