Skip to content

Commit 124e71e

Browse files
authored
fixes crash for react native instrumenting fetch (getsentry#2510)
- check for global.document.createElement to be function before calling
1 parent f7742c2 commit 124e71e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/utils/src/supports.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export function supportsNativeFetch(): boolean {
106106
// so create a "pure" iframe to see if that has native fetch
107107
let result = false;
108108
const doc = global.document;
109-
if (doc) {
109+
if (doc && typeof doc.createElement === 'function') {
110110
try {
111111
const sandbox = doc.createElement('iframe');
112112
sandbox.hidden = true;

0 commit comments

Comments
 (0)