1
mirror of https://github.com/home-assistant/frontend synced 2024-09-25 09:39:00 +02:00

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}
?active=${this.selected === branch_path}
></hat-graph-node>
${ensureArray(branch.sequence).map((action, j) =>
this.render_action_node(
action,
`${branch_path}/sequence/${j}`
)
)}
${branch.sequence !== null
? ensureArray(branch.sequence).map((action, j) =>
this.render_action_node(
action,
`${branch_path}/sequence/${j}`
)
)
: ""}
</div>
`;
})
: ""}
<div ?track=${track_default}>
<hat-graph-spacer ?track=${track_default}></hat-graph-spacer>
${ensureArray(config.default)?.map((action, i) =>
this.render_action_node(action, `${path}/default/${i}`)
)}
${config.default !== null
? ensureArray(config.default)?.map((action, i) =>
this.render_action_node(action, `${path}/default/${i}`)
)
: ""}
</div>
</hat-graph-branch>
`;