Skip to content

Commit

Permalink
fix(GuildAuditLog): Assert target to null upon not finding invite c…
Browse files Browse the repository at this point in the history
…odes (#6171)
  • Loading branch information
Jiralite authored Jul 23, 2021
1 parent 870a0de commit c8ca7bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structures/GuildAuditLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ class GuildAuditLogsEntry {
let change = this.changes.find(c => c.key === 'code');
change = change.new ?? change.old;
return guild.invites.fetch().then(invites => {
this.target = invites.find(i => i.code === change);
this.target = invites.find(i => i.code === change) ?? null;
});
} else {
this.target = this.changes.reduce((o, c) => {
Expand Down

0 comments on commit c8ca7bf

Please sign in to comment.