Skip to content

Commit f20e60b

Browse files
committed
fix: error when Blob does not exist
1 parent dbfcc16 commit f20e60b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/https/request.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ export function createRequest(opts: HttpsRequestOptions, useLegacy: boolean = tr
526526
const typedArray = new Uint8Array(param.data);
527527
const nativeBuffer = java.nio.ByteBuffer.wrap(Array.from(typedArray));
528528
nData = nativeBuffer.array();
529-
} else if (param.data instanceof Blob) {
529+
} else if (typeof Blob !== 'undefined' && param.data instanceof Blob) {
530530
// Stolen from core xhr, not sure if we should use InternalAccessor, but it provides fast access.
531531
// @ts-ignore
532532
const typedArray = new Uint8Array(Blob.InternalAccessor.getBuffer(param.data).buffer.slice(0) as ArrayBuffer);

src/https/request.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ export function createRequest(opts: HttpsRequestOptions, useLegacy: boolean = tr
469469
} else if (data instanceof ArrayBuffer) {
470470
const buffer = new Uint8Array(data);
471471
data = NSData.dataWithData(buffer as any);
472-
} else if (data instanceof Blob) {
472+
} else if (typeof Blob !== 'undefined' && data instanceof Blob) {
473473
// Stolen from core xhr, not sure if we should use InternalAccessor, but it provides fast access.
474474
// @ts-ignore
475475
const buffer = new Uint8Array(Blob.InternalAccessor.getBuffer(data).buffer.slice(0) as ArrayBuffer);

0 commit comments

Comments
 (0)