[TS] Add null check in graph to prompt (#2727)

This commit is contained in:
filtered
2025-02-26 05:39:46 +11:00
committed by GitHub
parent 101e8dea11
commit c20ea0c523

View File

@@ -76,7 +76,10 @@ export const graphToPrompt = async (
if (!parent) continue
let link = node.getInputLink(i)
while (parent.mode === LGraphEventMode.BYPASS || parent.isVirtualNode) {
while (
parent?.mode === LGraphEventMode.BYPASS ||
parent?.isVirtualNode
) {
if (!link) break
if (parent.isVirtualNode) {
@@ -95,7 +98,7 @@ export const graphToPrompt = async (
const indexes = [link.origin_slot].concat(parentInputIndexes)
const matchingIndex = indexes.find(
(index) => parent.inputs[index]?.type === input.type
(index) => parent?.inputs[index]?.type === input.type
)
// No input types match
if (matchingIndex === undefined) break