mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
[TS] Add null check in graph to prompt (#2727)
This commit is contained in:
@@ -76,7 +76,10 @@ export const graphToPrompt = async (
|
|||||||
if (!parent) continue
|
if (!parent) continue
|
||||||
|
|
||||||
let link = node.getInputLink(i)
|
let link = node.getInputLink(i)
|
||||||
while (parent.mode === LGraphEventMode.BYPASS || parent.isVirtualNode) {
|
while (
|
||||||
|
parent?.mode === LGraphEventMode.BYPASS ||
|
||||||
|
parent?.isVirtualNode
|
||||||
|
) {
|
||||||
if (!link) break
|
if (!link) break
|
||||||
|
|
||||||
if (parent.isVirtualNode) {
|
if (parent.isVirtualNode) {
|
||||||
@@ -95,7 +98,7 @@ export const graphToPrompt = async (
|
|||||||
const indexes = [link.origin_slot].concat(parentInputIndexes)
|
const indexes = [link.origin_slot].concat(parentInputIndexes)
|
||||||
|
|
||||||
const matchingIndex = indexes.find(
|
const matchingIndex = indexes.find(
|
||||||
(index) => parent.inputs[index]?.type === input.type
|
(index) => parent?.inputs[index]?.type === input.type
|
||||||
)
|
)
|
||||||
// No input types match
|
// No input types match
|
||||||
if (matchingIndex === undefined) break
|
if (matchingIndex === undefined) break
|
||||||
|
|||||||
Reference in New Issue
Block a user