Skip to content

Node.js based forum software built for the modern web

fix: profile showing posts from deleted topics

Barış Soner Uşaklı2679f37deca8
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) {