mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Add defensive code to makeGetPostsInChannel to avoid panic (#24510)
This commit is contained in:
parent
6109330beb
commit
7e0d9110ed
@ -296,7 +296,7 @@ export function makeGetPostsInChannel(): (state: GlobalState, channelId: Channel
|
|||||||
for (let i = 0; i < postIds.length; i++) {
|
for (let i = 0; i < postIds.length; i++) {
|
||||||
const post = allPosts[postIds[i]];
|
const post = allPosts[postIds[i]];
|
||||||
|
|
||||||
if (shouldFilterJoinLeavePost(post, showJoinLeave, currentUser ? currentUser.username : '')) {
|
if (!post || shouldFilterJoinLeavePost(post, showJoinLeave, currentUser ? currentUser.username : '')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user