Skip to content

Commit

Permalink
fix: don't crash if post is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli authored and julianlam committed Aug 15, 2022
1 parent 3345870 commit e06e526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/posts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down

0 comments on commit e06e526

Please sign in to comment.