mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 20:25:44 +00:00
Bug 329831 r=annie.sullivan Make QueryStringToQueries return empty array if
there is no input.
This commit is contained in:
parent
472ec2a4eb
commit
b33591dc65
@ -1029,7 +1029,9 @@ interface nsINavHistoryService : nsISupports
|
||||
|
||||
/**
|
||||
* Converts a query URI-like string to an array of actual query objects for
|
||||
* use to executeQueries().
|
||||
* use to executeQueries(). The output query array may be empty if there is
|
||||
* no information. However, there will always be an options structure returned
|
||||
* (if nothing is defined, it will just have the default values).
|
||||
*/
|
||||
void queryStringToQueries(in AUTF8String aQueryString,
|
||||
[array, size_is(aResultCount)] out nsINavHistoryQuery aQueries, out PRUint32 aResultCount,
|
||||
|
@ -233,12 +233,15 @@ nsNavHistory::QueryStringToQueryArray(const nsACString& aQueryString,
|
||||
rv = TokenizeQueryString(aQueryString, &tokens);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = TokensToQueries(tokens, aQueries, options);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Unable to parse the query string: ");
|
||||
NS_WARNING(PromiseFlatCString(aQueryString).get());
|
||||
if (tokens.Length() > 0) {
|
||||
rv = TokensToQueries(tokens, aQueries, options);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Unable to parse the query string: ");
|
||||
NS_WARNING(PromiseFlatCString(aQueryString).get());
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// when there are no tokens, leave the query array empty
|
||||
|
||||
NS_ADDREF(*aOptions = options);
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user