Skip to content

Node.js based forum software built for the modern web

callback

barisusaklif562caaa61ac
diff --git a/src/user.js b/src/user.js
index 951b47e8d9..6cd1589a45 100644
--- a/src/user.js
+++ b/src/user.js
@@ -310,12 +310,10 @@ var
emitter.on('event:newpost', User.onNewPostMade);
User.incrementUserPostCountBy = function(uid, value, callback) {
+ callback = callback || function() {};
User.incrementUserFieldBy(uid, 'postcount', value, function(err, newpostcount) {
if (err) {
- if(typeof callback === 'function') {
- callback(err);
- }
- return;
+ return callback(err);
}
db.sortedSetAdd('users:postcount', newpostcount, uid, callback);
});