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));