Commit f0b4301d authored by Frederic Caplette's avatar Frederic Caplette

Prevent error when accessing optional needs in pipeline graph

It is possible when building the links arrays for needs
that a defined jobs in the needs array does not exist in
the object that contains all jobs. This is because a job
with rules may or may not exist at execution time.
This commit access safely the needs or return an empty value.

Changelog: fixed
parent ccfbbf39
......@@ -80,7 +80,7 @@ export const makeLinksFromNodes = (nodes, nodeDict) => {
export const getAllAncestors = (nodes, nodeDict) => {
const needs = nodes
.map((node) => {
return nodeDict[node].needs || '';
return nodeDict[node]?.needs || '';
})
.flat()
.filter(Boolean);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment