Skip to content

Commit

Permalink
fixes crash for react native instrumenting fetch (#2510)
Browse files Browse the repository at this point in the history
- check for global.document.createElement to be function before  calling
  • Loading branch information
mxs authored Mar 23, 2020
1 parent f7742c2 commit 124e71e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/utils/src/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function supportsNativeFetch(): boolean {
// so create a "pure" iframe to see if that has native fetch
let result = false;
const doc = global.document;
if (doc) {
if (doc && typeof doc.createElement === 'function') {
try {
const sandbox = doc.createElement('iframe');
sandbox.hidden = true;
Expand Down

0 comments on commit 124e71e

Please sign in to comment.