Skip to content

Node.js based forum software built for the modern web

refactor: check if tid is truthy

Barış Soner Uşaklı0e1ccfc988f6
diff --git a/src/privileges/topics.js b/src/privileges/topics.js
index 508f989f5a..5538e626d9 100644
--- a/src/privileges/topics.js
+++ b/src/privileges/topics.js
@@ -94,6 +94,7 @@ privsTopics.filterTids = async function (privilege, tids, uid) {
const canViewScheduled = _.zipObject(cids, results.view_scheduled);
tids = topicsData.filter(t => (
+ t.tid &&
cidsSet.has(t.cid) &&
(results.isAdmin || privsTopics.canViewDeletedScheduled(t, {}, canViewDeleted[t.cid], canViewScheduled[t.cid]))
)).map(t => t.tid);