If we run into a null child SHEntry while cloning, just clone it as null into

the new tree instead of bailing out on the clone altogether.  Bug 275890,
r=biesi, sr=darin
This commit is contained in:
bzbarsky%mit.edu 2005-01-12 02:49:24 +00:00
parent 681fcfb1b7
commit 220748d802

View File

@ -6582,11 +6582,14 @@ nsDocShell::CloneAndReplace(nsISHEntry * src, PRUint32 aCloneID,
for (PRInt32 i = 0; i < childCount; i++) {
nsCOMPtr<nsISHEntry> srcChild;
srcContainer->GetChildAt(i, getter_AddRefs(srcChild));
if (!srcChild)
return NS_ERROR_FAILURE;
if (!srcChild) {
// srcChild can be null for valid reasons, for example if the
// docshell at index i never loaded anything useful. So if we
// hit a null here, just go on; it'll be null in the cloned
// tree as well.
continue;
}
nsCOMPtr<nsISHEntry> destChild;
if (NS_FAILED(result))
return result;
result =
CloneAndReplace(srcChild, aCloneID, replaceEntry,
getter_AddRefs(destChild));