Skip to content

Node.js based forum software built for the modern web

update count even if its 0

barisusakli4ef2ae7ba2da
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);
});