From 2679f37deca86ed19cbf293e8e74922434a1b4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 4 Dec 2019 11:37:35 -0500 Subject: [PATCH] fix: profile showing posts from deleted topics --- src/controllers/accounts/profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/accounts/profile.js b/src/controllers/accounts/profile.js index 37585921ff..acb6c049d4 100644 --- a/src/controllers/accounts/profile.js +++ b/src/controllers/accounts/profile.js @@ -89,7 +89,7 @@ async function getPosts(callerUid, userData, setSuffix) { const keys = cids.map(c => 'cid:' + c + ':uid:' + userData.uid + ':' + setSuffix); const pids = await db.getSortedSetRevRange(keys, 0, 9); const postData = await posts.getPostSummaryByPids(pids, callerUid, { stripTags: false }); - return postData.filter(p => p && !p.deleted); + return postData.filter(p => p && !p.deleted && p.topic && !p.topic.deleted); } function addMetaTags(res, userData) {