Handle undefined this.websocket when stopping code

Fixes CODEOCEAN-CJ
This commit is contained in:
Sebastian Serth
2022-09-22 18:58:08 +02:00
committed by Sebastian Serth
parent 214aae2644
commit 2f622174fa

View File

@ -148,7 +148,7 @@ CodeOceanEditorEvaluation = {
*/
stopCode: function (event) {
event.preventDefault();
if (this.isActiveFileStoppable()) {
if (this.isActiveFileStoppable() && this.websocket) {
this.websocket.send(JSON.stringify({'cmd': 'client_kill'}));
this.killWebsocket();
this.cleanUpUI();