diff --git a/src/app.js b/src/app.js index 0a47339..cb89f76 100755 --- a/src/app.js +++ b/src/app.js @@ -122,6 +122,9 @@ app.ws('/ws/:repl_name', (ws, req) => { ws.on('close', () => { try { + if (!terminals[repl_name]) { + return; + } let stop_container = pty.spawn('docker', ["rm", "-f", repl_name]); stop_container.on('close', code => { if (DEBUG) console.log("Stopped container "+repl_name); diff --git a/src/web/index.html b/src/web/index.html index 9345087..0e9549c 100755 --- a/src/web/index.html +++ b/src/web/index.html @@ -53,7 +53,35 @@ d="M12 2.25a.75.75 0 0 1 .75.75v11.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 1 1 1.06-1.06l3.22 3.22V3a.75.75 0 0 1 .75-.75Zm-9 13.5a.75.75 0 0 1 .75.75v2.25a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5V16.5a.75.75 0 0 1 1.5 0v2.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V16.5a.75.75 0 0 1 .75-.75Z" clip-rule="evenodd" /> + + + + + + + +