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:
SpaceEEC
2021-06-10 18:42:45 +02:00
committed by GitHub
parent ffabec3a5e
commit 097c7b9cdd
5 changed files with 87 additions and 64 deletions

View File

@@ -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);
}
}
}