mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 01:20:09 +00:00
## Summary Fix `SubgraphNode.graph` property to match `LGraphNode` lifecycle contract. Previously declared as `override readonly graph` via constructor parameter promotion, which prevented `LGraph.remove()` from setting `node.graph = null`. ## Changes - Remove `readonly` from `SubgraphNode.graph` constructor parameter - Add `override graph: GraphOrSubgraph | null` as class property - Add `NullGraphError` guard in `rootGraph` getter with node ID for debugging - Add null guards in `ExecutableNodeDTO.resolveInput` and `imagePreviewStore.revokeSubgraphPreviews` - Add test verifying `rootGraph` throws after node removal ## Testing - Existing subgraph tests pass - New test confirms `NullGraphError` is thrown when accessing `rootGraph` on removed node --------- Co-authored-by: Amp <amp@ampcode.com>