mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 22:37:32 +00:00
Fix crash connecting to node with no slots (#644)
* Fix crash connecting to node with no slots * Add playwright test * Update test expectations [skip ci] --------- Co-authored-by: huchenlei <chenlei.hu@mail.utoronto.ca> Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -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'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
@@ -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 === '*'
|
||||
|
||||
Reference in New Issue
Block a user