mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
fs: fix fs.read when passing null value
PR-URL: https://github.com/nodejs/node/pull/32479 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
This commit is contained in:
1 parent
fb254d2a83
commit
defbc2ed82
2 files changed
+14
-4
No files matched your search
@@ -80,6 +80,14 @@ assert.throws(
|
||||
}
|
||||
);
|
||||
|
||||
['buffer', 'offset', 'length'].forEach((option) =>
|
||||
assert.throws(
|
||||
() => fs.read(fd, {
|
||||
[option]: null
|
||||
}),
|
||||
`not throws when options.${option} is null`
|
||||
));
|
||||
|
||||
assert.throws(
|
||||
() => fs.read(null, Buffer.alloc(1), 0, 1, 0),
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user