From 4a872236e1efcb04d0b895ba8d177f75462764b5 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Wed, 29 May 2024 06:03:31 -0300 Subject: [PATCH] Fix reporter breaking because of ConsoleShortcuts --- scripts/generateReport.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/generateReport.ts b/scripts/generateReport.ts index 8bb87d812..8d6445143 100644 --- a/scripts/generateReport.ts +++ b/scripts/generateReport.ts @@ -204,8 +204,13 @@ page.on("console", async e => { report.badWebpackFinds.push(await rawArgs[1].jsonValue() as string); } - if (isVencord) { - const args = await Promise.all(e.args().map(a => a.jsonValue())); + if (isVencord && level !== "error") { + let args: unknown[] = []; + try { + args = await Promise.all(e.args().map(a => a.jsonValue())); + } catch { + return; + } const [, tag, message] = args as Array; const cause = await maybeGetError(e.args()[3]);