Skip to content

Node.js based forum software built for the modern web

fix: closes #12787, filter null topics

Barış Soner Uşaklıc2600b124f8b
diff --git a/src/topics/thumbs.js b/src/topics/thumbs.js
index b002ddda78..f02ca334be 100644
--- a/src/topics/thumbs.js
+++ b/src/topics/thumbs.js
@@ -24,7 +24,7 @@ Thumbs.exists = async function (id, path) {
};
Thumbs.load = async function (topicData) {
- const mainPids = topicData.map(t => t.mainPid);
+ const mainPids = topicData.filter(Boolean).map(t => t.mainPid);
let hashes = await posts.getPostsFields(mainPids, ['attachments']);
hashes = hashes.map(o => o.attachments);
const topicsWithThumbs = topicData.filter((t, idx) => t &&