Return NS_RDF_NO_VALUE if the hostname or referrer are empty, rather than a failure code (bug 313214). Patch by marria@gmail.com, r=bsmedberg, sr=me.

This commit is contained in:
bryner%brianryner.com 2005-10-21 19:39:05 +00:00
parent e7d4fe7b3d
commit ff18a37d19

View File

@ -1921,6 +1921,9 @@ nsGlobalHistory::GetTarget(nsIRDFResource* aSource,
rv = GetRowValue(row, kToken_ReferrerColumn, str);
if (NS_FAILED(rv)) return rv;
// Avoid trying to create a resource from an empty string, which
// will raise an exception
if (str.IsEmpty()) return NS_RDF_NO_VALUE;
nsCOMPtr<nsIRDFResource> resource;
rv = gRDFService->GetResource(str, getter_AddRefs(resource));