From da0fe98edc81ed2fef2486950980f5b6131ea5b0 Mon Sep 17 00:00:00 2001 From: kpn3m000 Date: Thu, 3 Jul 2014 14:24:41 +0200 Subject: [PATCH] Fixes search on plugins without Description example "tables_ssl" --- src/static/js/pluginfw/installer.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js index e56026167..9f7ac939f 100644 --- a/src/static/js/pluginfw/installer.js +++ b/src/static/js/pluginfw/installer.js @@ -84,7 +84,14 @@ exports.search = function(searchTerm, maxCacheAge, cb) { for (var pluginName in results) { // for every available plugin if (pluginName.indexOf(plugins.prefix) != 0) continue; // TODO: Also search in keywords here! - if(searchTerm && !~pluginName.toLowerCase().indexOf(searchTerm) && !~results[pluginName].description.toLowerCase().indexOf(searchTerm)) continue; + if(searchTerm && !~results[pluginName].name.toLowerCase().indexOf(searchTerm) + && (typeof results[pluginName].description != "undefined" && !~results[pluginName].description.toLowerCase().indexOf(searchTerm) ) + ){ + if(typeof results[pluginName].description === "undefined"){ + console.debug('plugin without Description: %s', results[pluginName].name); + } + continue; + } res[pluginName] = results[pluginName]; } cb && cb(null, res)