Search: be resilient against buggy search providers

If a search provider returns a meta without a name, don't crash
constructing the actor.

https://bugzilla.gnome.org/show_bug.cgi?id=745861
This commit is contained in:
Giovanni Campagna 2015-03-08 16:20:10 -07:00
parent b0be6b8678
commit 8b5a44e119

View File

@ -205,6 +205,13 @@ const SearchResultsBase = new Lang.Class({
callback(false);
return;
}
if (metas.some(function(meta) {
return !meta.name || !meta.id;
})) {
log('Invalid result meta returned from search provider ' + this.provider.id);
callback(false);
return;
}
metasNeeded.forEach(Lang.bind(this, function(resultId, i) {
let meta = metas[i];