From 5ec77d4be488e80a9d083192b9a908010cacddf5 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 4 Dec 2014 13:04:58 -0500 Subject: [PATCH] FIX: If a category can't be found, don't include it in the list --- app/assets/javascripts/discourse/lib/search-for-term.js.es6 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 = [];