From 545dbbf0df4413a183ebd7eb16e4d5738fdd8f83 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 14 Nov 2014 18:03:19 -0500 Subject: [PATCH] check err and tids --- src/topics/unread.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/topics/unread.js b/src/topics/unread.js index af1a58d779..26c6ff1901 100644 --- a/src/topics/unread.js +++ b/src/topics/unread.js @@ -116,6 +116,10 @@ module.exports = function(Topics) { } privileges.topics.filter('read', tids, uid, function(err, tids) { + if (err || !tids.length) { + return callback(err, []); + } + var keys = tids.map(function(tid) { return 'topic:' + tid; });