Skip to content

Commit 5fec813

Browse files
Vikhyath MondretiVikhyath Mondreti
authored andcommitted
fix sourceBlock null check
1 parent 2d5da6e commit 5fec813

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-block-connections.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export function useBlockConnections(blockId: string) {
167167
.filter((edge) => edge.target === blockId)
168168
.map((edge) => {
169169
const sourceBlock = blocks[edge.source]
170+
if (!sourceBlock) return null
170171

171172
// Get the response format from the subblock store instead
172173
const responseFormatValue = useSubBlockStore
@@ -202,6 +203,7 @@ export function useBlockConnections(blockId: string) {
202203
responseFormat,
203204
}
204205
})
206+
.filter(Boolean) as ConnectedBlock[]
205207

206208
return {
207209
incomingConnections: allPathConnections,

0 commit comments

Comments
 (0)