From 351ee71d64959db734970ed8170b0c6e7d6d6d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 17 Jun 2024 18:07:21 -0400 Subject: [PATCH] fix: suggested topic tid --- src/topics/suggested.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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',