Skip to content

Commit

Permalink
fix: #1430 pre check
Browse files Browse the repository at this point in the history
  • Loading branch information
Siykt committed Oct 10, 2023
1 parent f9ea1ba commit 48bb6d1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/workflowEngine/WorkflowWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,29 @@ class WorkflowWorker {
prevBlockData,
nextBlockBreakpointCount = null
) {
// pre check
for (const connection of connections) {
const id = typeof connection === 'string' ? connection : connection.id;

const block = this.engine.blocks[id];

if (!block) {
console.error(`Block ${id} doesn't exist`);
this.engine.destroy('stopped');
return;
}

// pass disabled block
// eslint-disable-next-line no-continue
if (!block.data.disableBlock) continue;

// check if the next block is breakpoint
if (block.data?.$breakpoint) {
// set breakpoint state
nextBlockBreakpointCount = 0;
}
}

connections.forEach((connection, index) => {
const { id, targetHandle, sourceHandle } =
typeof connection === 'string'
Expand Down

0 comments on commit 48bb6d1

Please sign in to comment.