fix: don't crash if post is undefined

This commit is contained in:
Barış Soner Uşaklı
2024-11-13 16:28:16 -05:00
parent b13bd803d7
commit d477090804

View File

@@ -154,7 +154,7 @@ async function updateUserLastposttimes(uids, topicsData) {
async function updateGroupPosts(uids, topicsData) { async function updateGroupPosts(uids, topicsData) {
const postsData = await posts.getPostsData(topicsData.map(t => t && t.mainPid)); const postsData = await posts.getPostsData(topicsData.map(t => t && t.mainPid));
await Promise.all(postsData.map(async (post, i) => { await Promise.all(postsData.map(async (post, i) => {
if (topicsData[i]) { if (post && topicsData[i]) {
post.cid = topicsData[i].cid; post.cid = topicsData[i].cid;
await groups.onNewPostMade(post); await groups.onNewPostMade(post);
} }