We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fa908e4 + b3c07f4 commit f22fb6bCopy full SHA for f22fb6b
src/core/chunked_stream.js
@@ -301,7 +301,11 @@ class ChunkedStreamManager {
301
const readChunk = ({ value, done }) => {
302
try {
303
if (done) {
304
- resolve(arrayBuffersToBytes(chunks));
+ resolve(
305
+ chunks.length > 0 || !this.disableAutoFetch
306
+ ? arrayBuffersToBytes(chunks)
307
+ : null
308
+ );
309
chunks = null;
310
return;
311
}
@@ -322,6 +326,11 @@ class ChunkedStreamManager {
322
326
if (this.aborted) {
323
327
return; // Ignoring any data after abort.
324
328
329
+ if (!data) {
330
+ // The range request wasn't dispatched, see the "GetRangeReader" handler
331
+ // in the `src/display/api.js` file.
332
+ return;
333
+ }
325
334
this.onReceiveData({ chunk: data.buffer, begin });
335
});
336
0 commit comments