From d477090804ddba8ab916a48aa4c4c0c0011daf97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 13 Nov 2024 16:28:16 -0500 Subject: [PATCH] fix: don't crash if post is undefined --- src/topics/scheduled.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/topics/scheduled.js b/src/topics/scheduled.js index 5b98bea84f..138c1330bf 100644 --- a/src/topics/scheduled.js +++ b/src/topics/scheduled.js @@ -154,7 +154,7 @@ async function updateUserLastposttimes(uids, topicsData) { async function updateGroupPosts(uids, topicsData) { const postsData = await posts.getPostsData(topicsData.map(t => t && t.mainPid)); await Promise.all(postsData.map(async (post, i) => { - if (topicsData[i]) { + if (post && topicsData[i]) { post.cid = topicsData[i].cid; await groups.onNewPostMade(post); }