From 2f622174fa040006b7af62e5e2d278bc3c082b78 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Thu, 22 Sep 2022 18:58:08 +0200 Subject: [PATCH] Handle undefined `this.websocket` when stopping code Fixes CODEOCEAN-CJ --- app/assets/javascripts/editor/evaluation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();