Skip to content

Commit

Permalink
[TS] Add null check - strict Litegraph
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered committed Feb 25, 2025
1 parent 810a61f commit e9ad5af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/composables/usePaste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const usePaste = () => {
// No image node selected: add a new one
const newNode = LiteGraph.createNode('LoadImage')
newNode.pos = [canvas.graph_mouse[0], canvas.graph_mouse[1]]
imageNode = graph?.add(newNode) ?? null
if (newNode) imageNode = graph?.add(newNode) ?? null
graph?.change()
}
pasteItemOnNode(items, imageNode)
Expand All @@ -84,7 +84,7 @@ export const usePaste = () => {
// No audio node selected: add a new one
const newNode = LiteGraph.createNode('LoadAudio')
newNode.pos = [canvas.graph_mouse[0], canvas.graph_mouse[1]]
audioNode = graph?.add(newNode) ?? null
if (newNode) audioNode = graph?.add(newNode) ?? null
graph?.change()
}
pasteItemOnNode(items, audioNode)
Expand Down

0 comments on commit e9ad5af

Please sign in to comment.