mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 02:32:18 +00:00
[TS] Fix nullability (#2702)
`LGraphCanvas.graph` may explicity set to null by litegraph.
This commit is contained in:
@@ -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
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user