Skip to content

Commit

Permalink
fix: ensure client socket is writeable before writing to it
Browse files Browse the repository at this point in the history
Closes #231
  • Loading branch information
favna committed Jan 29, 2022
1 parent 45bf8dd commit 405190b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/Structures/NodeMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
}
Expand Down

0 comments on commit 405190b

Please sign in to comment.