mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 20:38:55 +00: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:
parent
02e5a7a012
commit
8f3eb9d0e7
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user