mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
fix: guard widget removal in SubgraphNode removing-input handler
Check that the widget belongs to this node before attempting removal. During construction, SubgraphInput._widget can reference a widget from a different SubgraphNode instance, causing a 'Widget not found' error. Amp-Thread-ID: https://ampcode.com/threads/T-019c5519-3184-7414-a5cc-7c571d319cbc Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -114,7 +114,8 @@ export class SubgraphNode extends LGraphNode implements BaseLGraph {
|
||||
'removing-input',
|
||||
(e) => {
|
||||
const widget = e.detail.input._widget
|
||||
if (widget) this.ensureWidgetRemoved(widget)
|
||||
if (widget && this.widgets.includes(widget))
|
||||
this.ensureWidgetRemoved(widget)
|
||||
|
||||
this.removeInput(e.detail.index)
|
||||
this.setDirtyCanvas(true, true)
|
||||
|
||||
Reference in New Issue
Block a user