diff --git a/browser_tests/nodeSearchBox.spec.ts b/browser_tests/nodeSearchBox.spec.ts index f987065b9..56a2fb3ca 100644 --- a/browser_tests/nodeSearchBox.spec.ts +++ b/browser_tests/nodeSearchBox.spec.ts @@ -65,4 +65,16 @@ test.describe('Node search box', () => { 'auto-linked-node-batch.png' ) }) + + test('Link release connecting to node with no slots', async ({ + comfyPage + }) => { + await comfyPage.disconnectEdge() + await expect(comfyPage.searchBox.input).toHaveCount(1) + await comfyPage.page.locator('.p-chip-remove-icon').click() + await comfyPage.searchBox.fillAndSelectFirstNode('KSampler') + await expect(comfyPage.canvas).toHaveScreenshot( + 'added-node-no-connection.png' + ) + }) }) diff --git a/browser_tests/nodeSearchBox.spec.ts-snapshots/added-node-no-connection-chromium-linux.png b/browser_tests/nodeSearchBox.spec.ts-snapshots/added-node-no-connection-chromium-linux.png new file mode 100644 index 000000000..ad8bd48b7 Binary files /dev/null and b/browser_tests/nodeSearchBox.spec.ts-snapshots/added-node-no-connection-chromium-linux.png differ diff --git a/src/types/litegraphTypes.ts b/src/types/litegraphTypes.ts index ec3d25c02..9c93d4b83 100644 --- a/src/types/litegraphTypes.ts +++ b/src/types/litegraphTypes.ts @@ -54,6 +54,8 @@ export class ConnectingLinkImpl implements ConnectingLink { connectTo(newNode: LGraphNode) { const newNodeSlots = this.releaseSlotType === 'output' ? newNode.outputs : newNode.inputs + if (!newNodeSlots) return + const newNodeSlot = newNodeSlots.findIndex( (slot: INodeSlot) => slot.type === this.type || slot.type === '*' || this.type === '*'