From b377d91155b70c087846c2a88298bbed8ee5eda6 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 15 Nov 2020 15:06:49 -0700 Subject: [PATCH] Enigma crashes trying to write to a node when that node disconnected #324 * Don't attempt to write to non-writable socket! --- core/client_term.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/client_term.js b/core/client_term.js index f537c359..e961394e 100644 --- a/core/client_term.js +++ b/core/client_term.js @@ -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);