Check for null action nodes before rendering (#10017)

This commit is contained in:
Philip Allgaier 2021-09-14 23:20:09 +02:00 committed by GitHub
parent 5893559951
commit cb11c6b3ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,21 +173,25 @@ export class HatScriptGraph extends LitElement {
?track=${track_this} ?track=${track_this}
?active=${this.selected === branch_path} ?active=${this.selected === branch_path}
></hat-graph-node> ></hat-graph-node>
${ensureArray(branch.sequence).map((action, j) => ${branch.sequence !== null
this.render_action_node( ? ensureArray(branch.sequence).map((action, j) =>
action, this.render_action_node(
`${branch_path}/sequence/${j}` action,
) `${branch_path}/sequence/${j}`
)} )
)
: ""}
</div> </div>
`; `;
}) })
: ""} : ""}
<div ?track=${track_default}> <div ?track=${track_default}>
<hat-graph-spacer ?track=${track_default}></hat-graph-spacer> <hat-graph-spacer ?track=${track_default}></hat-graph-spacer>
${ensureArray(config.default)?.map((action, i) => ${config.default !== null
this.render_action_node(action, `${path}/default/${i}`) ? ensureArray(config.default)?.map((action, i) =>
)} this.render_action_node(action, `${path}/default/${i}`)
)
: ""}
</div> </div>
</hat-graph-branch> </hat-graph-branch>
`; `;