Corrected getting empty tests

parent 58e6db90
......@@ -160,7 +160,14 @@ module.exports.getSolutionWithFileInfo = (solutionId) => {
let getTestsPromises = solution.task.tests.map(t => mongoose.tests.getTest(t));
promises.push(Promise.all(getTestsPromises).then(tests => {
solution.task.tests = tests.map(t => t.toObject());
solution.task.tests = [];
for(let t of tests) {
if(t === undefined || t === null)
continue;
solution.task.tests.push(t)
}
}));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment