From f6967d889e05719d62f15f3ff40cd992a4765c32 Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Thu, 14 Aug 2025 06:59:44 +0800 Subject: [PATCH] [backport 1.25] fix: Add guards for _listenerController.abort() calls in SubgraphNode (#4970) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #4968 to `core/1.25` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-4970-backport-1-25-fix-Add-guards-for-_listenerController-abort-calls-in-SubgraphNode-24e6d73d365081838ca0c1d0a1734ba0) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne --- .../litegraph/src/subgraph/SubgraphNode.ts | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/lib/litegraph/src/subgraph/SubgraphNode.ts b/src/lib/litegraph/src/subgraph/SubgraphNode.ts index b856af0ac..e7d721182 100644 --- a/src/lib/litegraph/src/subgraph/SubgraphNode.ts +++ b/src/lib/litegraph/src/subgraph/SubgraphNode.ts @@ -171,7 +171,12 @@ export class SubgraphNode extends LGraphNode implements BaseLGraph { subgraphInput: SubgraphInput, input: INodeInputSlot & Partial ) { - input._listenerController?.abort() + if ( + input._listenerController && + typeof input._listenerController.abort === 'function' + ) { + input._listenerController.abort() + } input._listenerController = new AbortController() const { signal } = input._listenerController @@ -207,7 +212,12 @@ export class SubgraphNode extends LGraphNode implements BaseLGraph { override configure(info: ExportedSubgraphInstance): void { for (const input of this.inputs) { - input._listenerController?.abort() + if ( + input._listenerController && + typeof input._listenerController.abort === 'function' + ) { + input._listenerController.abort() + } } this.inputs.length = 0 @@ -518,7 +528,12 @@ export class SubgraphNode extends LGraphNode implements BaseLGraph { } for (const input of this.inputs) { - input._listenerController?.abort() + if ( + input._listenerController && + typeof input._listenerController.abort === 'function' + ) { + input._listenerController.abort() + } } } }