Skip to content

Commit 37f37c8

Browse files
committed
fix: return unsigned views for empty backup snapshots
1 parent eb6aa7c commit 37f37c8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/api.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,8 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
12021202
destination = NULL;
12031203
// The private file is closed and unlinked below; hand its buffer
12041204
// to the caller rather than making a full-size FS.readFile copy.
1205-
binaryDb = file.contents.subarray(0, file.usedBytes);
1205+
binaryDb = new Uint8Array(file.contents.buffer,
1206+
file.contents.byteOffset, file.usedBytes);
12061207
if (binaryDb.length > 0) {
12071208
// All pages, including WAL pages, are in the backup.
12081209
// Make the exported copy independent of WAL support.

0 commit comments

Comments
 (0)