Skip to content

Commit

Permalink
fix(ui): nil pointer (#6210)
Browse files Browse the repository at this point in the history
Signed-off-by: Yvonnick Esnault <[email protected]>
  • Loading branch information
yesnault authored Jun 13, 2022
1 parent b7ef036 commit 8d041a0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/src/app/model/pipeline.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,17 @@ export class Pipeline {
s.jobs.forEach(j => {
let nextJobRef;
let loopAgain = true;
let idxJob;
do {
nextJobRef = Math.random();
loopAgain = editPipeline.stages.findIndex(st => st.jobs.findIndex(jb => jb.ref === nextRef) !== -1) !== -1;
idxJob = editPipeline.stages.findIndex(st => {
if (st && st.jobs) {
return st.jobs.findIndex(jb => jb.ref === nextRef);
} else {
return -1;
}
});
loopAgain = idxJob !== -1;
} while (loopAgain);
j.ref = nextJobRef;
});
Expand Down

0 comments on commit 8d041a0

Please sign in to comment.