diff --git a/src/controllers/search.js b/src/controllers/search.js index 5382c3db5b..329f599783 100644 --- a/src/controllers/search.js +++ b/src/controllers/search.js @@ -75,7 +75,7 @@ function buildCategories(uid, callback) { ]; categories = categories.filter(function(category) { - return !category.link && !parseInt(category.parentCid, 10); + return category && !category.link && !parseInt(category.parentCid, 10); }); categories.forEach(function(category) {