From 4ef2ae7ba2dad88312ec375cf3848b78e90a9bc4 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 27 Oct 2015 14:01:13 -0400 Subject: [PATCH] update count even if its 0 --- src/topics/tags.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/topics/tags.js b/src/topics/tags.js index e971f1b237..ef4fb04290 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -66,9 +66,10 @@ module.exports = function(Topics) { function updateTagCount(tag, callback) { callback = callback || function() {}; Topics.getTagTopicCount(tag, function(err, count) { - if (err || !count) { + if (err) { return callback(err); } + count = count || 0; db.sortedSetAdd('tags:topic:count', count, tag, callback); });