Skip to content

Commit b42c43a

Browse files
Vikhyath Mondretiwaleedlatif1
authored andcommitted
fix sourceBlock null check
1 parent 2d5da6e commit b42c43a

File tree

2 files changed

+2
-278
lines changed

2 files changed

+2
-278
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,

apps/sim/contexts/socket-context.test.tsx

Lines changed: 0 additions & 278 deletions
This file was deleted.

0 commit comments

Comments
 (0)