Merge pull request #102 from Tyriar/dont_crash_demo_refresh

Don't crash demo server on refresh
This commit is contained in:
Paris Kasidiaris
2016-06-09 09:49:28 +03:00
+5 -2
View File
@@ -29,9 +29,12 @@ app.ws('/bash', function(ws, req) {
cwd: process.env.PWD,
env: process.env
});
term.on('data', function(data) {
ws.send(data);
try {
ws.send(data);
} catch (ex) {
// The WebSocket is not open, ignore
}
});
ws.on('message', function(msg) {
term.write(msg);