From af29cab0a7de5985ecc363cf50101a1c0ea76e53 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Thu, 10 Apr 2003 18:17:57 +0000 Subject: [PATCH] Bug 201423 Crash [@ nsWebShell::Create] if urildr.dll is missing r=adamlock sr=bz git-svn-id: svn://10.0.0.236/trunk@140983 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 15 ++++++++++----- mozilla/xpfe/appshell/src/nsWebShellWindow.cpp | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index dd50f18830d..1da05860075 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -1222,14 +1222,19 @@ NS_IMETHODIMP nsWebShell::Create() WEB_TRACE(WEB_TRACE_CALLS, ("nsWebShell::Init: this=%p", this)); - // HACK....force the uri loader to give us a load cookie for this webshell...then get it's + // HACK....force the uri loader to give us a load cookie for this webshell...then get its // doc loader and store it...as more of the docshell lands, we'll be able to get rid // of this hack... - nsCOMPtr uriLoader = do_GetService(NS_URI_LOADER_CONTRACTID); - uriLoader->GetDocumentLoaderForContext(NS_STATIC_CAST(nsIWebShell*, this), - getter_AddRefs(mDocLoader)); + nsresult rv; + nsCOMPtr uriLoader = do_GetService(NS_URI_LOADER_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); - nsCOMPtr shellAsContainer = do_QueryInterface(NS_STATIC_CAST(nsIWebShell*, this)); + rv = uriLoader->GetDocumentLoaderForContext(NS_STATIC_CAST(nsIWebShell*, this), + getter_AddRefs(mDocLoader)); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr shellAsContainer; + CallQueryInterface(this, NS_STATIC_CAST(nsIContentViewerContainer**, getter_AddRefs(shellAsContainer))); // Set the webshell as the default IContentViewerContainer for the loader... mDocLoader->SetContainer(shellAsContainer); diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index d8257696b48..b60b1b3ce5c 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -327,7 +327,7 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent, nsnull, nsnull, nsnull); - NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); + NS_ENSURE_SUCCESS(rv, rv); } return rv;