diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index 6de9527158a..671608fb48e 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -709,20 +709,19 @@ nsWebShell::GetLinkState(const nsACString& aLinkURI, nsLinkState& aState) nsresult rv; // get the cached IO service - if (!mIOService) { - mIOService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); - - if (NS_SUCCEEDED(rv)) { + if (!mIOService) + mIOService = do_GetService(NS_IOSERVICE_CONTRACTID); - // clean up the url using the right parser - nsCOMPtr uri; - rv = NS_NewURI(getter_AddRefs(uri), aLinkURI, nsnull, nsnull, - mIOService); + if (mIOService) { - // now get the fully canonicalized path - if (NS_SUCCEEDED(rv)) - rv = uri->GetSpec(resolvedPath); - } + // clean up the url using the right parser + nsCOMPtr uri; + rv = NS_NewURI(getter_AddRefs(uri), aLinkURI, nsnull, nsnull, + mIOService); + + // now get the fully canonicalized path + if (NS_SUCCEEDED(rv)) + rv = uri->GetSpec(resolvedPath); } PRBool isVisited;