if (chromeBase == nsnull) return NS_OK;
nsChromeRegistry::GetChromeResource(nsString& aResult,                                     nsIRDFResource* aChromeResource,                                    nsIRDFResource* aProperty){    nsresult rv = NS_OK;    if (gRegistryDB == nsnull)        return NS_ERROR_FAILURE; // Must have a DB to attempt this operation.    nsCOMPtr<nsIRDFNode> chromeBase;    if (NS_FAILED(rv = gRegistryDB->GetTarget(aChromeResource, aProperty, PR_TRUE, getter_AddRefs(chromeBase)))) {        NS_ERROR("Unable to obtain a base resource.");        return rv;    }        nsCOMPtr<nsIRDFResource> resource;    nsCOMPtr<nsIRDFLiteral> literal;    if (NS_SUCCEEDED(rv = chromeBase->QueryInterface(kIRDFResourceIID,                                                     (void**) getter_AddRefs(resource)))) {        nsXPIDLCString uri;        resource->GetValue( getter_Copies(uri) );        aResult = uri;    }    else if (NS_SUCCEEDED(rv = chromeBase->QueryInterface(kIRDFLiteralIID,                                                      (void**) getter_AddRefs(literal)))) {        nsXPIDLString s;        literal->GetValue( getter_Copies(s) );        aResult = s;    }    else {        // This should _never_ happen.        NS_ERROR("uh, this isn't a resource or a literal!");        return NS_ERROR_UNEXPECTED;    }    return NS_OK;}