зеркало из https://github.com/mozilla/pjs.git
Only warn in debug builds, and don't assert on user defined actions. bug 153783, r+sr=jst
This commit is contained in:
Родитель
735e2002df
Коммит
0eddfd0fda
|
@ -2366,14 +2366,14 @@ nsDocShell::GetChildAt(PRInt32 aIndex, nsIDocShellTreeItem ** aChild)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(aChild);
|
NS_ENSURE_ARG_POINTER(aChild);
|
||||||
|
|
||||||
NS_WARN_IF_FALSE(aIndex >=0 && aIndex < mChildList.Count(),
|
#ifdef DEBUG
|
||||||
"index of child element is out of range!");
|
|
||||||
if (aIndex < 0) {
|
if (aIndex < 0) {
|
||||||
printf("Don't be so negative!");
|
NS_WARNING("Negative index passed to GetChildAt");
|
||||||
}
|
}
|
||||||
else if (aIndex >= mChildList.Count()) {
|
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);
|
nsIDocumentLoader* child = SafeChildAt(aIndex);
|
||||||
NS_ENSURE_TRUE(child, NS_ERROR_UNEXPECTED);
|
NS_ENSURE_TRUE(child, NS_ERROR_UNEXPECTED);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче