diff --git a/app/assets/javascripts/discourse/lib/search-for-term.js.es6 b/app/assets/javascripts/discourse/lib/search-for-term.js.es6 index 592195f72..9f9c3faba 100644 --- a/app/assets/javascripts/discourse/lib/search-for-term.js.es6 +++ b/app/assets/javascripts/discourse/lib/search-for-term.js.es6 @@ -39,9 +39,8 @@ export default function searchForTerm(term, opts) { }); results.categories = results.categories.map(function(category){ - category = Discourse.Category.list().findProperty('id', category.id); - return category; - }); + return Discourse.Category.list().findProperty('id', category.id); + }).compact(); var r = results.grouped_search_result; results.resultTypes = [];