Преглед на файлове

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);