mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
fix: don't patch missing properties from partial payloads (#5796)
* fix: don't patch missing properties from partial payloads * fix(GuildChannel): initialize permissionOverwrites in the constructor * refactor(GuildChannel): remove redundant if
This commit is contained in:
@@ -17,7 +17,6 @@ class StoreChannel extends GuildChannel {
|
||||
/**
|
||||
* If the guild considers this channel NSFW
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
this.nsfw = Boolean(data.nsfw);
|
||||
}
|
||||
@@ -25,7 +24,9 @@ class StoreChannel extends GuildChannel {
|
||||
_patch(data) {
|
||||
super._patch(data);
|
||||
|
||||
if (typeof data.nsfw !== 'undefined') this.nsfw = Boolean(data.nsfw);
|
||||
if ('nsfw' in data) {
|
||||
this.nsfw = Boolean(data.nsfw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user