24560. Fixing jsurl document.write('foo') assertion/crash. Now returning

and error code from the channel creation which notifies the webshell
that all is okay but there is no channel to read from.

r=warren.


git-svn-id: svn://10.0.0.236/trunk@60432 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%netscape.com
2000-02-11 04:48:09 +00:00
parent 49787b4bdd
commit 2386c0a0cd
2 changed files with 14 additions and 4 deletions

View File

@@ -71,6 +71,7 @@
#include "nsIGlobalHistory.h"
#include "prmem.h"
#include "nsXPIDLString.h"
#include "nsDOMError.h"
#include "nsIDOMHTMLElement.h"
#include "nsIDOMHTMLDocument.h"
#include "nsLayoutCID.h"
@@ -1719,8 +1720,12 @@ nsWebShell::DoLoadURL(nsIURI * aUri,
rv = pNetService->NewChannelFromURI(aCommand, aUri, loadGroup, requestor,
aType, referrer /* referring uri */, 0, 0,
getter_AddRefs(pChannel));
if (NS_FAILED(rv)) return rv; // uhoh we were unable to get a channel to handle the url!!!
if (NS_FAILED(rv)) {
if (rv == NS_ERROR_DOM_RETVAL_UNDEFINED) // if causing the channel changed the
return NS_OK; // dom and there is nothing else to do
else
return rv; // uhoh we were unable to get a channel to handle the url!!!
}
// Mark the channel as being a document URI...
nsLoadFlags loadAttribs = 0;
pChannel->GetLoadAttributes(&loadAttribs);