Merge pull request #2193 from kpn3m000/develop
Fixes exception on search (plugins without description)pull/2218/head
commit
03ead389ba
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue