From 405190bbf1e4a174f46c75baf8b3b75621bf02fb Mon Sep 17 00:00:00 2001 From: Jeroen Claassens Date: Sat, 29 Jan 2022 11:46:47 +0100 Subject: [PATCH] fix: ensure client socket is writeable before writing to it Closes #231 --- src/lib/Structures/NodeMessage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Structures/NodeMessage.ts b/src/lib/Structures/NodeMessage.ts index 5340a9b8..573db107 100644 --- a/src/lib/Structures/NodeMessage.ts +++ b/src/lib/Structures/NodeMessage.ts @@ -50,7 +50,7 @@ export class NodeMessage { * @param content The content to send. */ public reply(content: unknown): void { - if (this.receptive) { + if (this.receptive && this.client.socket.writable) { this.client.socket!.write(createFromID(this.id, false, serialize(content))); } }