From be61bd35aede8217d151bf6840f3f47564bbca9e Mon Sep 17 00:00:00 2001 From: "norris%netscape.com" Date: Tue, 21 Mar 2000 23:14:29 +0000 Subject: [PATCH] Fix 32595 BAD: browser crashed on links. r=mstoltz git-svn-id: svn://10.0.0.236/trunk@63649 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/appshell/src/nsSessionHistory.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/mozilla/xpfe/appshell/src/nsSessionHistory.cpp b/mozilla/xpfe/appshell/src/nsSessionHistory.cpp index 4cdc0d3cf6f..76bc697ca46 100644 --- a/mozilla/xpfe/appshell/src/nsSessionHistory.cpp +++ b/mozilla/xpfe/appshell/src/nsSessionHistory.cpp @@ -457,9 +457,11 @@ GenerateTree(const char * aStickyUrl, nsIWebShell * aStickyContainer, nsIWebShel nsCOMPtr docShell = do_QueryInterface(aContainer); nsCOMPtr 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 docShellAsItem; docShellAsNode->GetChildAt(i, getter_AddRefs(docShellAsItem)); nsCOMPtr 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 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)