refactor: check if tid is truthy

This commit is contained in:
Barış Soner Uşaklı
2026-01-12 20:49:31 -05:00
parent 81cac01525
commit 0e1ccfc988

View File

@@ -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);