From 64261eee6e2a54af5eff3555fbdf1cb42c3fd956 Mon Sep 17 00:00:00 2001 From: Sapphire Date: Sun, 6 Dec 2026 05:11:09 -0500 Subject: [PATCH] Log warning if sendCrashReport is called while Sentry is uninitialised --- gui/electron/main/sentry.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gui/electron/main/sentry.ts b/gui/electron/main/sentry.ts index 2b7c39669..971ed2d37 100644 --- a/gui/electron/main/sentry.ts +++ b/gui/electron/main/sentry.ts @@ -185,7 +185,13 @@ export function captureServerExit( } export function sendCrashReport(kind: CrashReportKind) { - if (!Sentry.isInitialized()) return false; + if (!Sentry.isInitialized()) { + logger.warn( + { kind }, + 'Tried to send Sentry crash report before Sentry has initialised' + ); + return false; + } const failure = lastServerFailure; Sentry.withScope((scope) => { scope.setTag(USER_REQUESTED_TAG, 'true');