From 8f3eb9d0e7bbbfa67058c67c5e5c1484dee1ef9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 17 Oct 2024 23:57:05 +0100 Subject: [PATCH] fix(ext/node): add null check for kStreamBaseField (#26368) It's not guaranteed that `kStreamBaseField` is not undefined, so added a check for it. Closes https://github.com/denoland/deno/issues/26363 --- ext/node/polyfills/internal_binding/tcp_wrap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;