Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/extensions/core/widgetInputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,14 @@ export class PrimitiveNode extends LGraphNode {

#onFirstConnection(recreating?: boolean) {
// First connection can fire before the graph is ready on initial load so random things can be missing
if (!this.outputs[0].links) {
if (!this.outputs[0].links || !this.graph) {
this.onLastDisconnect()
return
}
const linkId = this.outputs[0].links[0]
// @ts-expect-error fixme ts strict error
const link = this.graph.links[linkId]
if (!link) return

// @ts-expect-error fixme ts strict error
const theirNode = this.graph.getNodeById(link.target_id)
if (!theirNode || !theirNode.inputs) return

Expand Down
2 changes: 2 additions & 0 deletions src/lib/litegraph/src/LGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,8 @@ export class LGraph

const subgraph = this.createSubgraph(data)
subgraph.configure(data)
for (const node of subgraph.nodes) node.onGraphConfigured?.()
for (const node of subgraph.nodes) node.onAfterGraphConfigured?.()

// Position the subgraph input nodes
subgraph.inputNode.arrange()
Expand Down