Skip to content

Commit

Permalink
[TS] Fix nullability (#2702)
Browse files Browse the repository at this point in the history
`LGraphCanvas.graph` may explicity set to null by litegraph.
  • Loading branch information
webfiltered authored Feb 24, 2025
1 parent 822a8e0 commit 97f9d65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/composables/useCoreCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export function useCoreCommands(): ComfyCommand[] {
'Comfy.GroupSelectedNodes.Padding'
)
group.resizeTo(canvas.selectedItems, padding)
canvas.graph.add(group)
canvas.graph?.add(group)
useTitleEditorStore().titleEditorTarget = group
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/composables/usePaste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export const usePaste = () => {
const newNode = LiteGraph.createNode('LoadImage')
// @ts-expect-error array to Float32Array
newNode.pos = [...canvas.graph_mouse]
imageNode = graph.add(newNode) ?? null
graph.change()
imageNode = graph?.add(newNode) ?? null
graph?.change()
}
pasteItemOnNode(items, imageNode)
return
Expand Down

0 comments on commit 97f9d65

Please sign in to comment.