From ffcf4dbbce138a23759515d09f5072f0af277967 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Mon, 9 Nov 2020 21:20:01 +0100 Subject: [PATCH] Prevent access to file_role if no valid response was received --- 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 4c40a9e7..ad91f9fe 100644 --- a/app/assets/javascripts/editor/evaluation.js +++ b/app/assets/javascripts/editor/evaluation.js @@ -64,7 +64,7 @@ CodeOceanEditorEvaluation = { printScoringResults: function (response) { $('#results ul').first().html(''); - $('.test-count .number').html(response.filter(function(x) { return x.file_role === 'teacher_defined_test'; }).length); + $('.test-count .number').html(response.filter(function(x) { return x && x.file_role === 'teacher_defined_test'; }).length); this.clearOutput(); _.each(response, function (result, index) {