From a40f48fe29ec5f36bfa3f5a666073c89f388c983 Mon Sep 17 00:00:00 2001 From: Ryan K Date: Thu, 12 Dec 2024 09:49:57 -0800 Subject: [PATCH] Fix: Cannot Read Properties of Null (Reading 'send') --- shims/net/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shims/net/index.ts b/shims/net/index.ts index 2136263..781b9ff 100644 --- a/shims/net/index.ts +++ b/shims/net/index.ts @@ -501,7 +501,9 @@ export class Socket extends EventEmitter { if (this.writeBuffer === undefined) { this.writeBuffer = data; setTimeout(() => { - this.ws!.send(this.writeBuffer!); + if(this.ws) { + this.ws!.send(this.writeBuffer!); + } this.writeBuffer = undefined; }, 0); } else {