From 8b5a44e11924c3f572238955fb26120e3d5342ac Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sun, 8 Mar 2015 16:20:10 -0700 Subject: [PATCH] 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 --- js/ui/search.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/ui/search.js b/js/ui/search.js index 7e7cb83fa..e307ce3f8 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -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];