Skip to content

Commit

Permalink
[TS] Add null check in graph to prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered committed Feb 25, 2025
1 parent 101e8de commit 0dcd442
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/executionUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ 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) {
Expand All @@ -95,7 +95,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
Expand Down

0 comments on commit 0dcd442

Please sign in to comment.