From e90a9646f4c1f729861c4e46d1c77ec2eb8846e4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:55:37 +0000 Subject: [PATCH] fix: handle process.env being undefined in debug func (#354) --- src/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index 297017ca..9d8e22c4 100644 --- a/src/core.ts +++ b/src/core.ts @@ -1059,7 +1059,7 @@ function applyHeadersMut(targetHeaders: Headers, newHeaders: Headers): void { } export function debug(action: string, ...args: any[]) { - if (typeof process !== 'undefined' && process.env['DEBUG'] === 'true') { + if (typeof process !== 'undefined' && process?.env?.['DEBUG'] === 'true') { console.log(`Mux:DEBUG:${action}`, ...args); } }