if (NS_FAILED(rv))
if (NS_FAILED(rv) || scheme.IsEmpty())
si_ExtractRealm(nsIURI *uri, nsCString &realm){  nsCAutoString hostPort;  /* Security check: if URI is of a scheme that doesn't support hostnames,   * we have no host to get the signon data from, so we must not attempt to   * build a valid realm from the URI (bug 159484) */  nsresult rv = uri->GetHostPort(hostPort);  if (NS_FAILED(rv))    return PR_FALSE;  nsCAutoString scheme;  rv = uri->GetScheme(scheme);  if (NS_FAILED(rv))    return PR_FALSE;  realm = scheme + NS_LITERAL_CSTRING("://") + hostPort;  return PR_TRUE;}