fix: don't patch set data with undefined (#6694)

This commit is contained in:
Rodry
2021-10-03 13:59:52 +01:00
committed by GitHub
parent 8b4456e0aa
commit 9eb9591473
33 changed files with 1211 additions and 795 deletions

View File

@@ -25,11 +25,13 @@ class GuildBan extends Base {
}
_patch(data) {
/**
* The user this ban applies to
* @type {User}
*/
this.user = this.client.users._add(data.user, true);
if ('user' in data) {
/**
* The user this ban applies to
* @type {User}
*/
this.user = this.client.users._add(data.user, true);
}
if ('reason' in data) {
/**