diff --git a/src/privileges/posts.js b/src/privileges/posts.js index 6096c1f552..6270b6e99e 100644 --- a/src/privileges/posts.js +++ b/src/privileges/posts.js @@ -112,7 +112,7 @@ module.exports = function(privileges) { pids = postData.filter(function(post) { - return cids.indexOf(post.topic.cid) !== -1 && + return post.topic && cids.indexOf(post.topic.cid) !== -1 && ((parseInt(post.topic.deleted, 10) !== 1 && parseInt(post.deleted, 10) !== 1) || results.isAdmin || isModOf[post.cid]); }).map(function(post) { return post.pid;