Skip to content

Commit

Permalink
fix(GuildAuditLogsEntry): default to object with id for deleted targe…
Browse files Browse the repository at this point in the history
…ts (#3373)
  • Loading branch information
vladfrangu authored and SpaceEEC committed Aug 28, 2019
1 parent dcee09c commit 43c0a79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/structures/GuildAuditLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class GuildAuditLogs {
* * An emoji
* * An invite
* * A webhook
* * An object with an id key if target was deleted
* * An object where the keys represent either the new value or the old value
* @typedef {?Object|Guild|User|Role|Emoji|Invite|Webhook} AuditLogEntryTarget
*/
Expand Down Expand Up @@ -341,7 +342,7 @@ class GuildAuditLogsEntry {
} else if (targetType === Targets.MESSAGE) {
this.target = guild.client.users.get(data.target_id);
} else {
this.target = guild[`${targetType.toLowerCase()}s`].get(data.target_id);
this.target = guild[`${targetType.toLowerCase()}s`].get(data.target_id) || { id: data.target_id };
}
}

Expand Down

0 comments on commit 43c0a79

Please sign in to comment.