Skip to content

Commit 878f577

Browse files
author
Brian Chen
authored
Check for process.env in isMockPersistence (#2407)
1 parent b1ca46d commit 878f577

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/firestore/src/local/simple_db.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export class SimpleDb {
209209
static isMockPersistence(): boolean {
210210
return (
211211
typeof process !== 'undefined' &&
212-
process.env.USE_MOCK_PERSISTENCE === 'YES'
212+
process.env?.USE_MOCK_PERSISTENCE === 'YES'
213213
);
214214
}
215215

packages/firestore/test/util/test_platform.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export class FakeWindow {
4545
});
4646
this.fakeIndexedDb =
4747
fakeIndexedDb ||
48-
(typeof window !== 'undefined' && window.indexedDB) || null;
48+
(typeof window !== 'undefined' && window.indexedDB) ||
49+
null;
4950
}
5051

5152
get localStorage(): Storage {

0 commit comments

Comments
 (0)