Skip to content

Commit

Permalink
fix: provide defaults on empty user object (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
vyneer authored Nov 27, 2023
1 parent b58d5b7 commit 09e0b05
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/chat/js/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ class ChatUser {
this.displayName = user;
this.username = this.displayName.toLowerCase();
} else {
this.id = user.id;
this.displayName = user.nick;
this.id = user.id || null;
this.displayName = user.nick || '';
this.username = this.displayName.toLowerCase();
this.createdDate = user.createdDate;
this.features = user.features;
this.createdDate = user.createdDate || '';
this.features = user.features || [];
}
}

Expand Down

0 comments on commit 09e0b05

Please sign in to comment.