Enigma crashes trying to write to a node when that node disconnected #324

* Don't attempt to write to non-writable socket!
This commit is contained in:
Bryan Ashby 2020-11-15 15:06:49 -07:00
parent d1b97f04ff
commit b377d91155
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ ClientTerminal.prototype.write = function(s, convertLineFeeds, cb) {
};
ClientTerminal.prototype.rawWrite = function(s, cb) {
if(this.output) {
if(this.output && this.output.writable) {
this.output.write(s, err => {
if(cb) {
return cb(err);