diff --git a/src/controllers/tags.js b/src/controllers/tags.js index 52ef647625..4b8385b177 100644 --- a/src/controllers/tags.js +++ b/src/controllers/tags.js @@ -91,7 +91,8 @@ tagsController.getTag = async function (req, res) { }; tagsController.getTags = async function (req, res) { - const cids = await categories.getCidsByPrivilege('categories:cid', req.uid, 'topics:read'); + let cids = await categories.getCidsByPrivilege('categories:cid', req.uid, 'topics:read'); + cids = cids.filter(cid => cid !== -1); const [canSearch, tags] = await Promise.all([ privileges.global.can('search:tags', req.uid), topics.getCategoryTagsData(cids, 0, 99),