diff --git a/ext/node/polyfills/internal_binding/tcp_wrap.ts b/ext/node/polyfills/internal_binding/tcp_wrap.ts index 2856f808a1..d9f1c5356a 100644 --- a/ext/node/polyfills/internal_binding/tcp_wrap.ts +++ b/ext/node/polyfills/internal_binding/tcp_wrap.ts @@ -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;