Skip to content

Node.js based forum software built for the modern web

check username

barisusaklic2ca09356940
diff --git a/src/user/data.js b/src/user/data.js
index a2b0a313e0..e4bd7e8a2e 100644
--- a/src/user/data.js
+++ b/src/user/data.js
@@ -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();