From 485827db84f05aae16357f19ceae1004bf528701 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 14 Nov 2014 16:22:05 -0500 Subject: [PATCH] check count before privileges --- src/categories/recentreplies.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/categories/recentreplies.js b/src/categories/recentreplies.js index 2254e78957..80421bde7d 100644 --- a/src/categories/recentreplies.js +++ b/src/categories/recentreplies.js @@ -12,8 +12,11 @@ var async = require('async'), module.exports = function(Categories) { Categories.getRecentReplies = function(cid, uid, count, callback) { + if(!parseInt(count, 10)) { + return callback(null, []); + } privileges.categories.can('read', cid, uid, function(err, canRead) { - if (err || !canRead || !parseInt(count, 10)) { + if (err || !canRead) { return callback(err, []); }