check username

v1.18.x
barisusakli 9 years ago
parent c39aa07d6f
commit c2ca093569

@ -118,7 +118,7 @@ module.exports = function(User) {
} }
// User Icons // User Icons
if (user.hasOwnProperty('picture')) { if (user.hasOwnProperty('picture') && user.username) {
user['icon:text'] = (user.username[0] || '').toUpperCase(); user['icon:text'] = (user.username[0] || '').toUpperCase();
user['icon:bgColor'] = iconBackgrounds[Array.prototype.reduce.call(user.username, function(cur, next) { user['icon:bgColor'] = iconBackgrounds[Array.prototype.reduce.call(user.username, function(cur, next) {
return cur + next.charCodeAt(); return cur + next.charCodeAt();

Loading…
Cancel
Save