Skip to content

Commit 2138cee

Browse files
[fix] ensure consistent link release behavior for subgraph IO nodes (#4931)
1 parent 7972550 commit 2138cee

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lib/litegraph/src/canvas/LinkConnector.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,10 @@ export class LinkConnector {
640640

641641
if (connectingTo === 'input' && ioNode instanceof SubgraphOutputNode) {
642642
const output = ioNode.getSlotInPosition(canvasX, canvasY)
643-
if (!output) throw new Error('No output slot found for link.')
643+
if (!output) {
644+
this.dropOnNothing(event)
645+
return
646+
}
644647

645648
// Track the actual slot to use for all connections
646649
let targetSlot = output
@@ -669,7 +672,10 @@ export class LinkConnector {
669672
ioNode instanceof SubgraphInputNode
670673
) {
671674
const input = ioNode.getSlotInPosition(canvasX, canvasY)
672-
if (!input) throw new Error('No input slot found for link.')
675+
if (!input) {
676+
this.dropOnNothing(event)
677+
return
678+
}
673679

674680
// Same logic for SubgraphInputNode if needed
675681
let targetSlot = input

0 commit comments

Comments
 (0)