Prevent access to file_role if no valid response was received

This commit is contained in:
Sebastian Serth
2020-11-09 21:20:01 +01:00
parent 84c291626f
commit ffcf4dbbce

View File

@ -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) {