From 6ac8d9d3499e7386e5d237574d4a0a664254d703 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 29 Aug 2014 17:55:44 -0400 Subject: [PATCH] check uid --- src/user.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/user.js b/src/user.js index 16ce0fe537..67a8c81c4d 100644 --- a/src/user.js +++ b/src/user.js @@ -443,10 +443,16 @@ var }; User.ignoreCategory = function(uid, cid, callback) { + if (!uid) { + return callback(); + } db.sortedSetAdd('uid:' + uid + ':ignored:cids', Date.now(), cid, callback); }; User.watchCategory = function(uid, cid, callback) { + if (!uid) { + return callback(); + } db.sortedSetRemove('uid:' + uid + ':ignored:cids', cid, callback); };