From 4802e5383e9105beadedbc931d3df49bc29a286a Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 28 Feb 2024 16:25:21 -0800 Subject: [PATCH] Fix an issue where the logger blew up while flashing --- src/renderer/utils/Logger.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/utils/Logger.js b/src/renderer/utils/Logger.js index da2e8b35c..4298c7cec 100644 --- a/src/renderer/utils/Logger.js +++ b/src/renderer/utils/Logger.js @@ -46,9 +46,9 @@ class Logger { getCallSite() { const err = new Error(); Error.captureStackTrace(err, this.getCallSite); - const stack = err.stack.split("\n")[3]; // Adjust this value as needed + const stack = err?.stack.split("\n")[3]; // Extract and format call site from stack trace - return stack.trim().replace(/^at\s+/g, ""); + return stack?.trim()?.replace(/^at\s+/g, ""); } }