Skip to content

Commit

Permalink
πŸ› Fix possible error thrown when discord ipc stream is not writable
Browse files Browse the repository at this point in the history
  • Loading branch information
NovusTheory committed Feb 7, 2024
1 parent 9bf1679 commit 6000955
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -60,7 +60,12 @@ export default class IPCClient extends EventEmitter {
buffer.writeInt32LE(length, 4);
buffer.write(json, 8, length);

this.socket.write(buffer);
if (!this.socket.writable) {
this.socket.write(buffer);
} else {
this.socket.end();
this.createSocket();
}
}

public close() {
Expand Down

0 comments on commit 6000955

Please sign in to comment.