Skip to content

Node.js based forum software built for the modern web

fix: suggested topic tid

Barış Soner Uşaklı351ee71d6495
diff --git a/src/topics/suggested.js b/src/topics/suggested.js
index f23f0a7079..8863db68f1 100644
--- a/src/topics/suggested.js
+++ b/src/topics/suggested.js
@@ -11,7 +11,10 @@ const plugins = require('../plugins');
module.exports = function (Topics) {
Topics.getSuggestedTopics = async function (tid, uid, start, stop, cutoff = 0) {
let tids;
- tid = parseInt(tid, 10);
+ if (!tid) {
+ return [];
+ }
+ tid = String(tid);
cutoff = cutoff === 0 ? cutoff : (cutoff * 2592000000);
const { cid, title, tags } = await Topics.getTopicFields(tid, [
'cid', 'title', 'tags',