Skip to content

Commit 8c9f045

Browse files
committed
chore: end early for unconnected element
1 parent 73c62d1 commit 8c9f045

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/main/libs/Compiler.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ export class Compiler {
5454
for (const connector of currentElement.connectors) {
5555
const foundConnector = this.recurse(connector);
5656
// Check if the reference exists in the flow elements
57-
if (!foundConnector) {
58-
continue;
59-
}
6057
const nextElement = flow.elements?.find(
6158
(element) => element instanceof FlowNode && element.name === foundConnector.reference
6259
);
@@ -68,13 +65,10 @@ export class Compiler {
6865
return nextElements;
6966
}
7067

71-
private recurse(connector: FlowElementConnector): FlowElementConnector | void {
72-
if (connector.reference) {
68+
private recurse(connector: FlowElementConnector): FlowElementConnector {
69+
if (connector.reference || !connector.connector) {
7370
return connector;
7471
}
75-
if (!connector) {
76-
return;
77-
}
7872
return this.recurse(new FlowElementConnector("connector", connector.connector, {}));
7973
}
8074
}

0 commit comments

Comments
 (0)