From c8ca7bfd2c5e7b29e54987a78301e9bdfa4a717b Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Fri, 23 Jul 2021 01:17:02 +0100 Subject: [PATCH] fix(GuildAuditLog): Assert `target` to null upon not finding invite codes (#6171) --- src/structures/GuildAuditLogs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structures/GuildAuditLogs.js b/src/structures/GuildAuditLogs.js index c4431b7b82bb..468f60763156 100644 --- a/src/structures/GuildAuditLogs.js +++ b/src/structures/GuildAuditLogs.js @@ -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) => {