From bee8b14e3186c12a8fcda6835fef72e6d1472be5 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 3 May 2022 23:39:19 +0200 Subject: [PATCH] Add safecheck on telemetry --- lib/telemetry/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/telemetry/src/index.ts b/lib/telemetry/src/index.ts index 1b00c7f2bf5e..864a66828577 100644 --- a/lib/telemetry/src/index.ts +++ b/lib/telemetry/src/index.ts @@ -28,7 +28,7 @@ export const telemetry = async ( telemetryData.payload.error = sanitizeError(error); } - if (!telemetryData.payload.error || options.enableCrashReports) { + if (!telemetryData.payload.error || options?.enableCrashReports) { if (process.env?.STORYBOOK_DEBUG_TELEMETRY) { logger.info('\n[telemetry]'); logger.info(JSON.stringify(telemetryData, null, 2));