fixing id_sup entries in stu_sup without related supervisor

parent 3f89a158
Showing with 1 additions and 1 deletions
......@@ -321,7 +321,7 @@ module.exports = {
if (!supOffs || supOffs.length == 0) {
// if we get here, only the requester being directly related to the
// student is valid
var supIdx = stuSups.findIndex(x => x.supervisor.id == id_sup);
var supIdx = stuSups.findIndex(x => x.supervisor && x.supervisor.id == id_sup);
if (supIdx >= 0)
return callback(null, [stuSups[supIdx].supervisor]);
throw new Error("No supervisors related");
......
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 sign in to comment