Fix 32595 BAD: browser crashed on links.

r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@63649 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
norris%netscape.com 2000-03-21 23:14:29 +00:00
parent 938b04adf8
commit be61bd35ae

View File

@ -457,9 +457,11 @@ GenerateTree(const char * aStickyUrl, nsIWebShell * aStickyContainer, nsIWebShel
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(aContainer);
nsCOMPtr<nsIURI> uri;
docShell->GetCurrentURI(getter_AddRefs(uri));
nsXPIDLCString spec;
uri->GetSpec(getter_Copies(spec));
hEntry->Create(spec, aContainer, aReferrer, aParent, aSHist);
if (uri) {
nsXPIDLCString spec;
uri->GetSpec(getter_Copies(spec));
hEntry->Create(spec, aContainer, aReferrer, aParent, aSHist);
}
}
// If the webshell has children, go thro' the child list and create
@ -473,7 +475,6 @@ GenerateTree(const char * aStickyUrl, nsIWebShell * aStickyContainer, nsIWebShel
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem;
docShellAsNode->GetChildAt(i, getter_AddRefs(docShellAsItem));
nsCOMPtr<nsIWebShell> childWS(do_QueryInterface(docShellAsItem));
//nsHistoryEntry * hChild = nsnull;
if (childWS) {
GenerateTree(aStickyUrl, aStickyContainer, childWS, hEntry, aSHist, aReferrer);
}
@ -544,7 +545,7 @@ nsHistoryEntry::Load(nsIWebShell * aPrevEntry, PRBool aIsReload) {
prevShell = do_QueryInterface(prev);
if (prevShell) {
nsCOMPtr<nsIURI> pURI;
if (NS_SUCCEEDED(prevShell->GetCurrentURI(getter_AddRefs(pURI)))) {
if (NS_SUCCEEDED(prevShell->GetCurrentURI(getter_AddRefs(pURI))) && pURI) {
nsXPIDLCString spec;
if (NS_SUCCEEDED(pURI->GetSpec(getter_Copies(spec))))
pSURL = spec;
@ -556,9 +557,6 @@ nsHistoryEntry::Load(nsIWebShell * aPrevEntry, PRBool aIsReload) {
cSURL = cURL;
}
// NS_ADDREF(aPrevEntry);
//Compare the URLs
{
if ((pSURL) == cURL)