File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -448,14 +448,14 @@ export function useActions(
448
448
nextEdges = Array . isArray ( nextEdges ) ? nextEdges : [ nextEdges ]
449
449
450
450
const validEdges = state . isValidConnection
451
- ? nextEdges . filter ( ( edge ) =>
452
- state . isValidConnection ! ( edge , {
451
+ ? nextEdges . filter ( ( edge ) => {
452
+ return state . isValidConnection ?. ( edge , {
453
453
edges : state . edges ,
454
454
nodes : state . nodes ,
455
455
sourceNode : findNode ( edge . source ) ! ,
456
456
targetNode : findNode ( edge . target ) ! ,
457
- } ) ,
458
- )
457
+ } )
458
+ } )
459
459
: nextEdges
460
460
461
461
const changes = validEdges . reduce ( ( edgeChanges , connection ) => {
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ export function addEdgeToStore(
16
16
triggerError : State [ 'hooks' ] [ 'error' ] [ 'trigger' ] ,
17
17
defaultEdgeOptions ?: DefaultEdgeOptions ,
18
18
) : GraphEdge | false {
19
- if ( ! edgeParams . source || ! edgeParams . target ) {
20
- triggerError ( new VueFlowError ( ErrorCode . EDGE_INVALID , ( edgeParams as Edge ) . id ) )
19
+ if ( ! edgeParams || ! edgeParams . source || ! edgeParams . target ) {
20
+ triggerError ( new VueFlowError ( ErrorCode . EDGE_INVALID , ( edgeParams as undefined | Edge ) ? .id ?? `[ID UNKNOWN]` ) )
21
21
return false
22
22
}
23
23
You can’t perform that action at this time.
0 commit comments