Skip to content

Node.js based forum software built for the modern web

pass string to isUUID

Barış Soner Uşaklıb1e134b44ef0
diff --git a/src/controllers/topics.js b/src/controllers/topics.js
index ae68290729..4cacc31cd9 100644
--- a/src/controllers/topics.js
+++ b/src/controllers/topics.js
@@ -26,7 +26,7 @@ topicsController.get = async function getTopic(req, res, next) {
const tid = req.params.topic_id;
if (
(req.params.post_index && !utils.isNumber(req.params.post_index) && req.params.post_index !== 'unread') ||
- (!utils.isNumber(tid) && !validator.isUUID(tid))
+ (!utils.isNumber(tid) && !validator.isUUID(String(tid)))
) {
return next();
}