fix(nodes,edges): check if type exists before using as index

This commit is contained in:
Braks
2022-04-04 21:42:48 +02:00
parent 984e34a9fb
commit c12e07bcda
2 changed files with 2 additions and 2 deletions
@@ -80,7 +80,7 @@ export default {
:id="edge.id"
:key="edge.id"
:edge="edge"
:name="edge.type ? names[edge.type] : 'default'"
:name="typeof edge.type !== 'undefined' && typeof names[edge.type] !== 'undefined' ? names[edge.type] : 'default'"
:selectable="typeof edge.selectable === 'undefined' ? store.elementsSelectable : edge.selectable"
:updatable="typeof edge.updatable === 'undefined' ? store.edgesUpdatable : edge.updatable"
>
@@ -49,7 +49,7 @@ export default {
:id="node.id"
:key="`vue-flow__node-${node.id}`"
:node="node"
:name="node.type ? names[node.type] : 'default'"
:name="typeof node.type !== 'undefined' && typeof names[node.type] !== 'undefined' ? names[node.type] : 'default'"
:draggable="typeof node.draggable === 'undefined' ? store.nodesDraggable : !!node.draggable"
:selectable="typeof node.selectable === 'undefined' ? store.elementsSelectable : !!node.selectable"
:connectable="typeof node.connectable === 'undefined' ? store.nodesConnectable : !!node.connectable"