From 2adb5815bf786633a6314973637d28a2d7c9d61a Mon Sep 17 00:00:00 2001 From: Souvik <56929455+PASTUSEDBY@users.noreply.github.com> Date: Wed, 12 Aug 2020 00:28:52 +0530 Subject: [PATCH] fix: set #nickname to null as the default value (#4641) --- src/structures/GuildMember.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index f9495174e..4c8c49a31 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -66,16 +66,18 @@ class GuildMember extends Base { */ this.deleted = false; - this._roles = []; - if (data) this._patch(data); - } - - _patch(data) { /** * The nickname of this member, if they have one * @type {?string} * @name GuildMember#nickname */ + this.nickname = null; + + this._roles = []; + if (data) this._patch(data); + } + + _patch(data) { if (typeof data.nick !== 'undefined') this.nickname = data.nick; if (data.joined_at) this.joinedTimestamp = new Date(data.joined_at).getTime();