From f0e694f87139195beb38d19c415dfd9fbc5bbf08 Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Fri, 20 Sep 2002 00:03:03 +0000 Subject: [PATCH] Additional changes related to previous checkin for bug 151061. More error checking per discussion in the bug. git-svn-id: svn://10.0.0.236/trunk@130090 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index ee67b41c9f0..02dc9891d50 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -3953,18 +3953,16 @@ nsDocShell::Embed(nsIContentViewer * aContentViewer, // the document to the original http url that created the document.write(). // This makes sure that all relative urls in a document.written page loaded // via history work properly. - PRBool historyLoad = PR_FALSE, isWyciwyg = PR_FALSE; - - if (mLoadType & LOAD_CMD_HISTORY || + if (mCurrentURI && + (mLoadType & LOAD_CMD_HISTORY || mLoadType == LOAD_RELOAD_NORMAL || - mLoadType == LOAD_RELOAD_CHARSET_CHANGE) - historyLoad = PR_TRUE; - - rv = mCurrentURI->SchemeIs("wyciwyg", &isWyciwyg); - - if (historyLoad && NS_SUCCEEDED(rv) && isWyciwyg) - SetBaseUrlForWyciwyg(aContentViewer); - + mLoadType == LOAD_RELOAD_CHARSET_CHANGE)){ + PRBool isWyciwyg = PR_FALSE; + // Check if the url is wyciwyg + rv = mCurrentURI->SchemeIs("wyciwyg", &isWyciwyg); + if (isWyciwyg && NS_SUCCEEDED(rv)) + SetBaseUrlForWyciwyg(aContentViewer); + } // XXX What if SetupNewViewer fails? if (mLSHE) mOSHE = mLSHE;