Skip to content

Commit

Permalink
fix(ext/node): add null check for kStreamBaseField (#26368)
Browse files Browse the repository at this point in the history
It's not guaranteed that `kStreamBaseField` is not undefined, so
added a check for it.

Closes #26363
  • Loading branch information
bartlomieju committed Oct 17, 2024
1 parent d1be72b commit 0db05b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/node/polyfills/internal_binding/tcp_wrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export class TCP extends ConnectionWrap {
* @return An error status code.
*/
setNoDelay(noDelay: boolean): number {
if ("setNoDelay" in this[kStreamBaseField]) {
if (this[kStreamBaseField] && "setNoDelay" in this[kStreamBaseField]) {
this[kStreamBaseField].setNoDelay(noDelay);
}
return 0;
Expand Down

0 comments on commit 0db05b8

Please sign in to comment.