From 37fb43f55b9a3e6380e31a69c553562e973d0785 Mon Sep 17 00:00:00 2001 From: "mrbkap%gmail.com" Date: Wed, 22 Feb 2006 02:28:04 +0000 Subject: [PATCH] Only warn in debug builds, and don't assert on user defined actions. bug 153783, r+sr=jst --- docshell/base/nsDocShell.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index d2b447111baf..fa8f8d369c0a 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -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);