deason hace 3 años
padre
commit
a2ee9a50d4

+ 5 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamRecordPaperStructServiceImpl.java

@@ -1,5 +1,6 @@
 package cn.com.qmth.examcloud.core.oe.admin.service.impl;
 
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.core.oe.admin.base.Constants;
 import cn.com.qmth.examcloud.core.oe.admin.base.utils.Check;
 import cn.com.qmth.examcloud.core.oe.admin.base.utils.NewQuestionType;
@@ -50,6 +51,10 @@ public class ExamRecordPaperStructServiceImpl implements ExamRecordPaperStructSe
         Check.isNull(examRecordDataId, "examRecordDataId不能为空");
 
         ExamRecordDataEntity examRecordDataEntity = GlobalHelper.getEntity(examRecordDataRepo, examRecordDataId, ExamRecordDataEntity.class);
+        if (examRecordDataEntity == null) {
+            throw new StatusException("400404", "未找到考试记录数据");
+        }
+
         String paperStructId = examRecordDataEntity.getPaperStructId();
         ExamRecordPaperStructEntity examRecordPaperStruct = null;
         if (StringUtils.isBlank(paperStructId)) {