Skip to content

Commit 2adb581

Browse files
authored
fix: set #nickname to null as the default value (#4641)
1 parent 3df9993 commit 2adb581

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/structures/GuildMember.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,18 @@ class GuildMember extends Base {
6666
*/
6767
this.deleted = false;
6868

69-
this._roles = [];
70-
if (data) this._patch(data);
71-
}
72-
73-
_patch(data) {
7469
/**
7570
* The nickname of this member, if they have one
7671
* @type {?string}
7772
* @name GuildMember#nickname
7873
*/
74+
this.nickname = null;
75+
76+
this._roles = [];
77+
if (data) this._patch(data);
78+
}
79+
80+
_patch(data) {
7981
if (typeof data.nick !== 'undefined') this.nickname = data.nick;
8082

8183
if (data.joined_at) this.joinedTimestamp = new Date(data.joined_at).getTime();

0 commit comments

Comments
 (0)