Browse Source

redirecting /items/[UUID] to /texts/[TEXTID]/[UUID] #2057

bach 1 year ago
parent
commit
718fc765ab
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/store/modules/corpus.js

+ 6 - 4
src/store/modules/corpus.js

@@ -45,10 +45,12 @@ export default {
       let recurseFlatToc = (state, eduuid, a) => {
       let recurseFlatToc = (state, eduuid, a) => {
         // console.log('recurseFlatToc', a)
         // console.log('recurseFlatToc', a)
         a.forEach((item, i) => {
         a.forEach((item, i) => {
-          state.editionsbyuuid[eduuid].flattoc.push(item.uuid)
-          state.numTocsItem++
-          if (item.children && item.children.length) {
-            recurseFlatToc(state, eduuid, item.children)
+          if (item) {
+            state.editionsbyuuid[eduuid].flattoc.push(item.uuid)
+            state.numTocsItem++
+            if (item.children && item.children.length) {
+              recurseFlatToc(state, eduuid, item.children)
+            }
           }
           }
         })
         })
       }
       }