fix(GuildAuditLog): Assert target to null upon not finding invite codes (#6171)

This commit is contained in:
Jiralite
2021-07-23 01:17:02 +01:00
committed by GitHub
parent 870a0de53c
commit c8ca7bfd2c

View File

@@ -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) => {