mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
fs: fix out of bounds error when reading chunks
This commit is contained in:
@@ -71,7 +71,7 @@ export default class FileHandle {
|
||||
|
||||
async readChunks(from: number, length: number): Promise<Blob> {
|
||||
const blobParts: BlobPart[] = [];
|
||||
for (let i = from; i < from + length; ++i) {
|
||||
for (let i = from; i < Math.min(from + length, this.file.chunks); ++i) {
|
||||
const array = await this.readChunk(i);
|
||||
if (!array) continue;
|
||||
blobParts.push(array.buffer);
|
||||
|
||||
Reference in New Issue
Block a user