From c3c85d8a0de342f4132cb3d0c1353c69b1a9f9a1 Mon Sep 17 00:00:00 2001 From: Kazumi Inada Date: Sun, 5 Dec 2021 15:48:12 +0900 Subject: [PATCH] fix: Add type check for process.env --- packages/database/src/api/Database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/database/src/api/Database.ts b/packages/database/src/api/Database.ts index 3b89056a4ad..bb56e3d3e1a 100644 --- a/packages/database/src/api/Database.ts +++ b/packages/database/src/api/Database.ts @@ -128,7 +128,7 @@ export function repoManagerDatabaseFromApp( let isEmulator: boolean; let dbEmulatorHost: string | undefined = undefined; - if (typeof process !== 'undefined') { + if (typeof process !== 'undefined' && process.env) { dbEmulatorHost = process.env[FIREBASE_DATABASE_EMULATOR_HOST_VAR]; }