From 0e1ccfc988f6dcd3ba77fcd96dbd350f353875ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 12 Jan 2026 20:49:31 -0500 Subject: [PATCH] refactor: check if tid is truthy --- src/privileges/topics.js | 1 + 1 file changed, 1 insertion(+) 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);