We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29a2e09 commit a3de6d6Copy full SHA for a3de6d6
src/lib/libwasmfs_fetch.js
@@ -90,6 +90,12 @@ addToLibrary({
90
// one request for all the chunks we need, rather than one
91
// request per chunk.
92
var start = firstChunk * chunkSize;
93
+
94
+ // Out of bounds. No request necessary.
95
+ if (start >= wasmFS$JSMemoryRanges[file].size) {
96
+ return Promise.resolve();
97
+ }
98
99
// We must fetch *up to* the last byte of the last chunk.
100
var end = (lastChunk+1) * chunkSize;
101
var response = await fetch(url, {headers:{'Range': `bytes=${start}-${end-1}`}});
0 commit comments