fixed uncaught exception

Bryan Roe committed Dec 12, 2019 at 11:59 UTC dacca97512c9e95c5d50e655ec65efe39542a24e
1 file changed +4 -1
agents/meshcore.js
+4 -1
@@ -1161,7 +1161,10 @@ function createMeshCore(agent) {
1161 this.ws._term = c;
1162 c.pipe(this.ws, { dataTypeSkip: 1 });
1163 this.ws.pipe(c, { dataTypeSkip: 1, end: false });
1164 - this.ws.prependListener('end', function () { this.httprequest._term.end(function () { console.log("Terminal was closed"); }); });
1164 + this.ws.prependListener('end', function ()
1165 + {
1166 + if (this.httprequest._term) { this.httprequest._term.end(function () { console.log("Terminal was closed"); }); }
1167 + });
1168 });
1169 }
1170 } catch (e)