lrf402788946 %!s(int64=4) %!d(string=hai) anos
pai
achega
6779dcdd4e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/service/uploadquestion.js

+ 1 - 1
app/service/uploadquestion.js

@@ -92,7 +92,7 @@ class UploadquestionService extends CrudService {
     for (const _res of res) {
       const elm = _.cloneDeep(JSON.parse(JSON.stringify(_res)));
       const stu = await this.smodel.findById(elm.studentid);
-      elm.studentname = stu.name;
+      if (stu) { elm.studentname = stu.name; }
       data.push(elm);
     }
     return { data, total };