Add defensive code to makeGetPostsInChannel to avoid panic (#24510)

Этот коммит содержится в:
Ben Schumacher
2023-09-12 17:04:16 +02:00
коммит произвёл GitHub
родитель 6109330beb
Коммит 7e0d9110ed

Просмотреть файл

@@ -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;
}