From 7009181d9ef3cf971194b572bbee76b7fd996654 Mon Sep 17 00:00:00 2001 From: Kazumi Inada Date: Tue, 12 Apr 2022 00:36:29 +0900 Subject: [PATCH] fix: Add type check for process.env (#5790) --- 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]; }