Skip to content

Commit 3131da6

Browse files
committed
net: use asserts in JS Socket Stream to catch races in future
1 parent 62ec9d9 commit 3131da6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/internal/js_stream_socket.js

+3
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class JSStreamSocket extends Socket {
149149
}
150150

151151
const handle = this._handle;
152+
assert(handle !== null);
152153

153154
process.nextTick(() => {
154155
// Ensure that write is dispatched asynchronously.
@@ -181,6 +182,8 @@ class JSStreamSocket extends Socket {
181182
}
182183

183184
const handle = this._handle;
185+
assert(handle !== null);
186+
184187
const self = this;
185188

186189
let pending = bufs.length;

0 commit comments

Comments
 (0)