Check for null and undefined before accessing stderr and stdout

This commit is contained in:
Sebastian Serth
2020-11-14 00:19:27 +01:00
parent afe0fc2255
commit 3cedcf5736

View File

@ -173,7 +173,7 @@ CodeOceanEditorEvaluation = {
},
printOutput: function (output, colorize, index) {
if (output === undefined || output.stderr === undefined && output.stdout === undefined) {
if (output === undefined || output === null || output.stderr === undefined && output.stdout === undefined) {
// Prevent empty element with no text at all
return;
}