Skip to content

Commit

Permalink
fix: provide defaults on empty user object
Browse files Browse the repository at this point in the history
  • Loading branch information
vyneer committed Nov 27, 2023
1 parent b58d5b7 commit 6765abe
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 6765abe

Please sign in to comment.