diff --git a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/posts.ts b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/posts.ts index dd875c93ad282..35574e8e7a9a7 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/posts.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/selectors/entities/posts.ts @@ -296,7 +296,7 @@ export function makeGetPostsInChannel(): (state: GlobalState, channelId: Channel for (let i = 0; i < postIds.length; i++) { const post = allPosts[postIds[i]]; - if (shouldFilterJoinLeavePost(post, showJoinLeave, currentUser ? currentUser.username : '')) { + if (!post || shouldFilterJoinLeavePost(post, showJoinLeave, currentUser ? currentUser.username : '')) { continue; }