Skip to content

Commit

Permalink
prevent currentRastrums etc. for unknown pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jpvoigt committed May 23, 2024
1 parent 1758b66 commit b69acd6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/store/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1997,6 +1997,9 @@ const dataModule = {
const surfaceId = page.id
const docPath = getters.documentPathByName(docName)
const dom = getters.documentByPath(docPath)
if (!dom) {
return null
}

const surface = dom.querySelector('surface[*|id="' + surfaceId + '"]')
const svgGraphic = surface.querySelector('graphic[type="shapes"]')
Expand Down Expand Up @@ -2696,6 +2699,10 @@ const dataModule = {
const docName = page.document
const docPath = getters.documentPathByName(docName)
const dom = getters.documentByPath(docPath)
if (!dom) {
console.warn(`no rastrums for "${docPath}"!`)
return []
}
const surfaceId = getters.currentSurfaceId
const surface = dom.querySelector('surface[*|id="' + surfaceId + '"]')

Expand Down

0 comments on commit b69acd6

Please sign in to comment.