fix: don't crash if post is undefined

isekai-main
Barış Soner Uşaklı 2 years ago
parent 6b2a6f9006
commit 4a3e36a766

@ -93,7 +93,7 @@ Posts.getPostIndices = async function (posts, uid) {
};
Posts.modifyPostByPrivilege = function (post, privileges) {
if (post.deleted && !(post.selfPost || privileges['posts:view_deleted'])) {
if (post && post.deleted && !(post.selfPost || privileges['posts:view_deleted'])) {
post.content = '[[topic:post_is_deleted]]';
if (post.user) {
post.user.signature = '';

Loading…
Cancel
Save