diff --git a/app/assets/javascripts/editor/evaluation.js b/app/assets/javascripts/editor/evaluation.js index 31666c0c..94894edb 100644 --- a/app/assets/javascripts/editor/evaluation.js +++ b/app/assets/javascripts/editor/evaluation.js @@ -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();