Commit 2037ee85 authored by Omar El-Mihilmy's avatar Omar El-Mihilmy Committed by Rich Trott
Browse files

fs: nullish coalescing to respect zero positional reads

When the file read position is moved passing zero is
not respected and `null` is used instead. PR fixes the
issues by using nullish coalescing which will return
the rhs only when the lhs is `null` or `undefined`;
respecting the zero.

Fixes: https://github.com/nodejs/node/issues/40715

PR-URL: https://github.com/nodejs/node/pull/40716
Fixes: https://github.com/nodejs/node/issues/40699


Reviewed-By: default avatarRobert Nagy <ronagy@icloud.com>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarTobias Nießen <tniessen@tnie.de>
Reviewed-By: default avatarEvan Lucas <evanlucas@me.com>
parent 055a38b4
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment