search: remove redundant check
We check for (metasNeeded.length == 0) at the beginning of the function, which is only ever called when when a non-zero number of results is received back from the provider. Effectively, this means that (metas.length != metasNeeded.length) will also catch (metas.length == 0) and print a nicer message to the log.
This commit is contained in:
parent
67a807e849
commit
8345fe006e
@ -199,10 +199,6 @@ const SearchResultsBase = new Lang.Class({
|
|||||||
this._cancellable.reset();
|
this._cancellable.reset();
|
||||||
|
|
||||||
this.provider.getResultMetas(metasNeeded, Lang.bind(this, function(metas) {
|
this.provider.getResultMetas(metasNeeded, Lang.bind(this, function(metas) {
|
||||||
if (metas.length == 0) {
|
|
||||||
callback(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (metas.length != metasNeeded.length) {
|
if (metas.length != metasNeeded.length) {
|
||||||
log('Wrong number of result metas returned by search provider ' + this.provider.id +
|
log('Wrong number of result metas returned by search provider ' + this.provider.id +
|
||||||
': expected ' + metasNeeded.length + ' but got ' + metas.length);
|
': expected ' + metasNeeded.length + ' but got ' + metas.length);
|
||||||
|
Loading…
Reference in New Issue
Block a user