1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00

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
This commit is contained in:
Bartek Iwańczuk 2024-10-17 23:57:05 +01:00 committed by GitHub
parent 02e5a7a012
commit 8f3eb9d0e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;