From 36c344cedc8866d22a8cc69c06e90694f297b61c Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Thu, 12 Dec 2019 11:59:05 -0800 Subject: [PATCH] fixed uncaught exception --- agents/meshcore.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index 32aae0c6..5090d5cb 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -1161,7 +1161,10 @@ function createMeshCore(agent) { this.ws._term = c; c.pipe(this.ws, { dataTypeSkip: 1 }); this.ws.pipe(c, { dataTypeSkip: 1, end: false }); - this.ws.prependListener('end', function () { this.httprequest._term.end(function () { console.log("Terminal was closed"); }); }); + this.ws.prependListener('end', function () + { + if (this.httprequest._term) { this.httprequest._term.end(function () { console.log("Terminal was closed"); }); } + }); }); } } catch (e)