Skip to content

Commit 721b73b

Browse files
author
Petar Slovic
committed
patch this blog thing
1 parent 55009e5 commit 721b73b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Libraries/Network/XMLHttpRequest.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,16 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
253253
break;
254254

255255
case 'blob':
256-
this._cachedResponse = BlobManager.createFromOptions(this._response);
256+
if (this._response.toString() === '') {
257+
this._cachedResponse = new Blob([]);
258+
break;
259+
}
260+
261+
if (typeof this._response === 'object' && this._response) {
262+
this._cachedResponse = BlobManager.createFromOptions(this._response);
263+
} else {
264+
throw new Error(`Invalid response for blob: ${this._response}`);
265+
}
257266
break;
258267

259268
case 'json':

0 commit comments

Comments
 (0)