소스 검색

questionList的可能为空

Michael Wang 3 년 전
부모
커밋
7c90ff9b98
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/features/student/importInspect/MarkBody.vue
  2. 1 1
      src/features/student/inspect/MarkBody.vue

+ 1 - 1
src/features/student/importInspect/MarkBody.vue

@@ -69,7 +69,7 @@ async function processImage() {
     const indexInSliceUrls = store.currentTask.sliceUrls.indexOf(url) + 1;
     const image = images[indexInSliceUrls - 1];
 
-    const trackLists = store.currentTask.questionList
+    const trackLists = (store.currentTask.questionList || [])
       .map((q) => q.trackList)
       .reduce((acc, t) => {
         acc = acc.concat(t);

+ 1 - 1
src/features/student/inspect/MarkBody.vue

@@ -69,7 +69,7 @@ async function processImage() {
     const indexInSliceUrls = store.currentTask.sliceUrls.indexOf(url) + 1;
     const image = images[indexInSliceUrls - 1];
 
-    const trackLists = store.currentTask.questionList
+    const trackLists = (store.currentTask.questionList || [])
       .map((q) => q.trackList)
       .reduce((acc, t) => {
         acc = acc.concat(t);