From 6f40393b993491b8b94f6e49e58535b77c24ab5e Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sun, 4 May 2014 14:33:12 -0400 Subject: [PATCH] added err check --- src/topics.js | 4 ++++ src/user/create.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/topics.js b/src/topics.js index 43dd9dadf2..63e2da86a7 100644 --- a/src/topics.js +++ b/src/topics.js @@ -63,6 +63,10 @@ var async = require('async'), } user.getNameSlugPicture(topic.uid, function(err, userData) { + if (err) { + return callback(err); + } + topic.user = userData; callback(err, topic); }); diff --git a/src/user/create.js b/src/user/create.js index 37cff32d72..dda4f1743d 100644 --- a/src/user/create.js +++ b/src/user/create.js @@ -126,10 +126,10 @@ module.exports = function(User) { }; db.setObject('user:' + uid, userData, function(err) { - if(err) { return callback(err); } + db.setObjectField('username:uid', userData.username, uid); db.setObjectField('userslug:uid', userData.userslug, uid);