Skip to content

Commit

Permalink
Merge pull request #35 from retejs/fix/view-exception
Browse files Browse the repository at this point in the history
fix: resolve exception triggered by asynchronous node removal
  • Loading branch information
Ni55aN authored Sep 30, 2023
2 parents 8b23471 + 5525712 commit b8aebd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ export class MinimapPlugin<Schemes extends ExpectedScheme> extends Scope<never,
return this.editor.getNodes().map(node => {
const view = this.area.nodeViews.get(node.id)

if (!view) throw new Error('view')
if (!view) return null

return {
width: node.width,
height: node.height,
left: view.position.x,
top: view.position.y
}
})
}).filter(Boolean) as Rect[]
}

private render() {
Expand Down

0 comments on commit b8aebd4

Please sign in to comment.