Преглед на файлове

fix: can't find block when using js block
extBlockId param (#1548)

Ahmad Kholid преди 1 година
родител
ревизия
3f165ff29c
променени са 1 файла, в които са добавени 12 реда и са изтрити 1 реда
  1. 12 1
      src/workflowEngine/blocksHandler/handlerJavascriptCode.js

+ 12 - 1
src/workflowEngine/blocksHandler/handlerJavascriptCode.js

@@ -222,10 +222,21 @@ export async function javascriptCode({ outputs, data, ...block }, { refData }) {
       insert = typeof insertData === 'boolean' ? insertData : true;
 
       if (inputNextBlockId) {
-        const customNextBlockId = this.getBlockConnections(inputNextBlockId);
+        let customNextBlockId = this.getBlockConnections(inputNextBlockId);
         if (!customNextBlockId)
           throw new Error(`Can't find block with "${inputNextBlockId}" id`);
 
+        const nextBlock = this.engine.blocks[inputNextBlockId];
+        if (!customNextBlockId && nextBlock) {
+          customNextBlockId = [
+            {
+              id: inputNextBlockId,
+              blockId: inputNextBlockId,
+              connections: new Map([]),
+            },
+          ];
+        }
+
         nextBlockId = customNextBlockId;
       }
     } else {