upgrade check

v1.18.x
Baris Soner Usakli 11 years ago
parent cbfba4b45b
commit 1a64e40b21

@ -65,8 +65,16 @@ Upgrade.upgrade = function(callback) {
async.each(uids, function(uid, next) {
User.getUserField(uid, 'username', function(err, username) {
newUserSlug = Utils.slugify(username);
User.setUserField(uid, 'userslug', newUserSlug, next);
if(err) {
return next(err);
}
if(username) {
newUserSlug = Utils.slugify(username);
User.setUserField(uid, 'userslug', newUserSlug, next);
} else {
winston.warn('uid '+ uid + 'doesn\'t have a valid username (' + username + '), skipping');
next(null);
}
});
}, function(err) {
next(err);

Loading…
Cancel
Save