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);