Skip to content

Commit

Permalink
Use nullish coalescing to respect zero positional reads
Browse files Browse the repository at this point in the history
  • Loading branch information
mihilmy committed Nov 3, 2021
1 parent 2e2a6fe commit b83faf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/fs/promises.js
Expand Up @@ -521,7 +521,7 @@ async function read(handle, bufferOrOptions, offset, length, position) {
}
offset = bufferOrOptions.offset || 0;
length = buffer.byteLength;
position = bufferOrOptions.position || null;
position = bufferOrOptions.position ?? null;
}

if (offset == null) {
Expand Down

0 comments on commit b83faf9

Please sign in to comment.