mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
fix: don't patch set data with undefined (#6694)
This commit is contained in:
@@ -41,8 +41,8 @@ class User extends Base {
|
||||
* @type {?string}
|
||||
*/
|
||||
this.username = data.username;
|
||||
} else if (typeof this.username !== 'string') {
|
||||
this.username = null;
|
||||
} else {
|
||||
this.username ??= null;
|
||||
}
|
||||
|
||||
if ('bot' in data) {
|
||||
@@ -61,8 +61,8 @@ class User extends Base {
|
||||
* @type {?string}
|
||||
*/
|
||||
this.discriminator = data.discriminator;
|
||||
} else if (typeof this.discriminator !== 'string') {
|
||||
this.discriminator = null;
|
||||
} else {
|
||||
this.discriminator ??= null;
|
||||
}
|
||||
|
||||
if ('avatar' in data) {
|
||||
@@ -71,8 +71,8 @@ class User extends Base {
|
||||
* @type {?string}
|
||||
*/
|
||||
this.avatar = data.avatar;
|
||||
} else if (typeof this.avatar !== 'string') {
|
||||
this.avatar = null;
|
||||
} else {
|
||||
this.avatar ??= null;
|
||||
}
|
||||
|
||||
if ('banner' in data) {
|
||||
@@ -82,8 +82,8 @@ class User extends Base {
|
||||
* @type {?string}
|
||||
*/
|
||||
this.banner = data.banner;
|
||||
} else if (typeof this.banner !== 'string') {
|
||||
this.banner = null;
|
||||
} else {
|
||||
this.banner ??= null;
|
||||
}
|
||||
|
||||
if ('accent_color' in data) {
|
||||
|
||||
Reference in New Issue
Block a user