From 8b7300530901fb59623d28778dd588f54165ea98 Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Thu, 18 Aug 2005 11:16:55 +0000 Subject: [PATCH] fixes bug 262183 "FFTrunk and Trunk crash [@ nsSHEntry::GetChildAt]" r=biesi sr=bzbarsky --- docshell/shistory/src/nsSHEntry.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docshell/shistory/src/nsSHEntry.cpp b/docshell/shistory/src/nsSHEntry.cpp index c6a1eb0e2555..572de0904284 100644 --- a/docshell/shistory/src/nsSHEntry.cpp +++ b/docshell/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; }