Browse Source

questionList的可能为空

Michael Wang 3 năm trước cách đây
mục cha
commit
7c90ff9b98

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