From a17351e47b1648ebb3bd271b343cbdbd0ea0cf20 Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Thu, 30 Sep 2004 05:15:38 +0000 Subject: [PATCH] fixes bug 262183 "FFTrunk and Trunk crash [@ nsSHEntry::GetChildAt]" r=biesi sr=bzbarsky git-svn-id: svn://10.0.0.236/trunk@162995 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/components/shistory/src/nsSHEntry.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mozilla/xpfe/components/shistory/src/nsSHEntry.cpp b/mozilla/xpfe/components/shistory/src/nsSHEntry.cpp index c6a1eb0e255..572de090428 100644 --- a/mozilla/xpfe/components/shistory/src/nsSHEntry.cpp +++ b/mozilla/xpfe/components/shistory/src/nsSHEntry.cpp @@ -393,7 +393,9 @@ nsSHEntry::GetChildAt(PRInt32 aIndex, nsISHEntry ** aResult) { if (aIndex >= 0 && aIndex < mChildren.Count()) { *aResult = mChildren[aIndex]; - NS_ADDREF(*aResult); + // yes, mChildren can have holes in it. AddChild's offset parameter makes + // that possible. + NS_IF_ADDREF(*aResult); } else { *aResult = nsnull; }