lrf402788946 4 سال پیش
والد
کامیت
79f7033372
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      app/service/uploadtask.js

+ 4 - 1
app/service/uploadtask.js

@@ -21,7 +21,10 @@ class UploadtaskService extends CrudService {
     for (const elm of res) {
       const _elm = _.cloneDeep(JSON.parse(JSON.stringify(elm)));
       const stu = await this.stumodel.findById(_elm.studentid);
-      _elm.stuname = stu.name;
+      if (stu)_elm.stuname = stu.name;
+      else {
+        console.error(`学生id:${_elm.studentid}/数据错误`);
+      }
       data.push(_elm);
     }
     return { data, total };