From 03e702040e596dd2408abc2b329d41ba4b7e581e Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Tue, 28 Sep 1999 22:11:26 +0000 Subject: [PATCH] Bug #12198 --> bullet proof this code. return if we don't have a nsIURI instead of trying to dereference it. r=sspitzer --- docshell/base/nsWebShell.cpp | 2 ++ webshell/src/nsWebShell.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index d2a2711d4f0..add7e65857f 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -2133,6 +2133,8 @@ nsWebShell::LoadURI(nsIURI * aUri, CancelRefreshURITimers(); nsXPIDLCString scheme, CUriSpec; + if (!aUri) return NS_ERROR_NULL_POINTER; + rv = aUri->GetScheme(getter_Copies(scheme)); if (NS_FAILED(rv)) return rv; rv = aUri->GetSpec(getter_Copies(CUriSpec)); diff --git a/webshell/src/nsWebShell.cpp b/webshell/src/nsWebShell.cpp index d2a2711d4f0..add7e65857f 100644 --- a/webshell/src/nsWebShell.cpp +++ b/webshell/src/nsWebShell.cpp @@ -2133,6 +2133,8 @@ nsWebShell::LoadURI(nsIURI * aUri, CancelRefreshURITimers(); nsXPIDLCString scheme, CUriSpec; + if (!aUri) return NS_ERROR_NULL_POINTER; + rv = aUri->GetScheme(getter_Copies(scheme)); if (NS_FAILED(rv)) return rv; rv = aUri->GetSpec(getter_Copies(CUriSpec));