summaryrefslogtreecommitdiff
path: root/ext/node
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-10-17 23:57:05 +0100
committerGitHub <noreply@github.com>2024-10-17 22:57:05 +0000
commit8f3eb9d0e7bbbfa67058c67c5e5c1484dee1ef9a (patch)
treeb395f97ec819cc675c6cfe63f0a8ace1b78ea501 /ext/node
parent02e5a7a012d0c53a61f5cb38f15b92dd0db4f841 (diff)
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
Diffstat (limited to 'ext/node')
-rw-r--r--ext/node/polyfills/internal_binding/tcp_wrap.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/node/polyfills/internal_binding/tcp_wrap.ts b/ext/node/polyfills/internal_binding/tcp_wrap.ts
index 2856f808a..d9f1c5356 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;