Skip to content

Commit 983571b

Browse files
committed
minor fix: create copy of data
1 parent 12ff51f commit 983571b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/gridfs/upload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ function doWrite(
455455
spaceRemaining -= numToCopy;
456456
let doc: GridFSChunk;
457457
if (spaceRemaining === 0) {
458-
doc = createChunkDoc(stream.id, stream.n, stream.bufToStore);
458+
doc = createChunkDoc(stream.id, stream.n, new Uint8Array(stream.bufToStore));
459459

460460
const remainingTimeMS = stream.timeoutContext?.remainingTimeMS;
461461
if (remainingTimeMS != null && remainingTimeMS <= 0) {

0 commit comments

Comments
 (0)