Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bc86084

Browse filesBrowse files
watildetargos
authored andcommitted
net: check if option is undefined
PR-URL: #40344 Fixes: #40336 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
1 parent 1e15137 commit bc86084
Copy full SHA for bc86084

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎lib/net.js‎

Copy file name to clipboardExpand all lines: lib/net.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,13 @@ const kSetNoDelay = Symbol('kSetNoDelay');
282282

283283
function Socket(options) {
284284
if (!(this instanceof Socket)) return new Socket(options);
285-
if (options.objectMode) {
285+
if (options?.objectMode) {
286286
throw new ERR_INVALID_ARG_VALUE(
287287
'options.objectMode',
288288
options.objectMode,
289289
'is not supported'
290290
);
291-
} else if (options.readableObjectMode || options.writableObjectMode) {
291+
} else if (options?.readableObjectMode || options?.writableObjectMode) {
292292
throw new ERR_INVALID_ARG_VALUE(
293293
`options.${
294294
options.readableObjectMode ? 'readableObjectMode' : 'writableObjectMode'

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.