lrf402788946 před 4 roky
rodič
revize
6779dcdd4e
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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 };