We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8be6ed commit 9c12d71Copy full SHA for 9c12d71
packages/firestore/src/platform/browser/base64.ts
@@ -22,7 +22,10 @@ export function decodeBase64(encoded: string): string {
22
try {
23
return atob(encoded);
24
} catch (e) {
25
- if (e instanceof DOMException) {
+ // Check that `DOMException` is defined before using it to avoid
26
+ // "ReferenceError: Property 'DOMException' doesn't exist" in react-native.
27
+ // (https://github.com/firebase/firebase-js-sdk/issues/7115)
28
+ if (typeof DOMException !== 'undefined' && e instanceof DOMException) {
29
throw new Base64DecodeError('Invalid base64 string: ' + e);
30
} else {
31
throw e;
0 commit comments