mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-06 23:59:46 +02:00
check username
This commit is contained in:
@@ -118,7 +118,7 @@ module.exports = function(User) {
|
||||
}
|
||||
|
||||
// User Icons
|
||||
if (user.hasOwnProperty('picture')) {
|
||||
if (user.hasOwnProperty('picture') && user.username) {
|
||||
user['icon:text'] = (user.username[0] || '').toUpperCase();
|
||||
user['icon:bgColor'] = iconBackgrounds[Array.prototype.reduce.call(user.username, function(cur, next) {
|
||||
return cur + next.charCodeAt();
|
||||
|
||||
Reference in New Issue
Block a user