From e694bd8ab595bc88509af68fea8a95aeb6887a5e Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 22 Mar 2016 09:47:29 +0200 Subject: [PATCH] closes #4431 --- src/controllers/tags.js | 3 +++ src/socket.io/topics/tags.js | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/controllers/tags.js b/src/controllers/tags.js index 60f4c1d028..af8f6058c0 100644 --- a/src/controllers/tags.js +++ b/src/controllers/tags.js @@ -65,6 +65,9 @@ tagsController.getTags = function(req, res, next) { if (err) { return next(err); } + tags = tags.filter(function(tag) { + return tag && tag.score > 0; + }); var data = { tags: tags, nextStart: 100, diff --git a/src/socket.io/topics/tags.js b/src/socket.io/topics/tags.js index 535fdc3027..f55ec377fb 100644 --- a/src/socket.io/topics/tags.js +++ b/src/socket.io/topics/tags.js @@ -20,14 +20,16 @@ module.exports = function(SocketTopics) { return callback(new Error('[[error:invalid-data]]')); } - var start = parseInt(data.after, 10), - stop = start + 99; + var start = parseInt(data.after, 10); + var stop = start + 99; topics.getTags(start, stop, function(err, tags) { if (err) { return callback(err); } - + tags = tags.filter(function(tag) { + return tag && tag.score > 0; + }); callback(null, {tags: tags, nextStart: stop + 1}); }); };