fix(GuildAuditLogsEntry): executor can be missing (#5500)

This commit is contained in:
Souji
2021-04-15 00:37:45 +02:00
committed by GitHub
parent fe93a7e084
commit e9bf206d88
2 changed files with 7 additions and 5 deletions

View File

@@ -319,11 +319,13 @@ class GuildAuditLogsEntry {
/**
* The user that executed this entry
* @type {User}
* @type {?User}
*/
this.executor = guild.client.options.partials.includes(PartialTypes.USER)
? guild.client.users.add({ id: data.user_id })
: guild.client.users.cache.get(data.user_id);
this.executor = data.user_id
? guild.client.options.partials.includes(PartialTypes.USER)
? guild.client.users.add({ id: data.user_id })
: guild.client.users.cache.get(data.user_id)
: null;
/**
* An entry in the audit log representing a specific change.