From feecf0b61ca5eff4cc502994e43ab59ceccd6874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 9 Jul 2017 21:08:03 -0400 Subject: [PATCH] dont make db call if guest --- src/topics/bookmarks.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/topics/bookmarks.js b/src/topics/bookmarks.js index b47d5f2278..975a0d54f8 100644 --- a/src/topics/bookmarks.js +++ b/src/topics/bookmarks.js @@ -8,6 +8,9 @@ var posts = require('../posts'); module.exports = function (Topics) { Topics.getUserBookmark = function (tid, uid, callback) { + if (!parseInt(uid, 10)) { + return callback(null, null); + } db.sortedSetScore('tid:' + tid + ':bookmarks', uid, callback); };