Skip to content

Commit 9622b72

Browse files
authored
Added extra check if pipeline has no jobs (#102)
1 parent 664e220 commit 9622b72

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

frontend/client/views/pipeline/detail.vue

+12-5
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ export default {
233233
jobs = pipeline.jobs
234234
}
235235
236+
// check if this pipeline has jobs
237+
if (!jobs) {
238+
return
239+
}
240+
236241
// Check if something has changed
237242
if (this.nodes) {
238243
var redraw = false
@@ -360,11 +365,13 @@ export default {
360365
361366
checkPipelineArgs () {
362367
// check if this pipeline has args
363-
for (let x = 0, y = this.pipeline.jobs.length; x < y; x++) {
364-
if (this.pipeline.jobs[x].args && this.pipeline.jobs[x].args.type !== 'vault') {
365-
// we found args. Redirect user to params view.
366-
this.$router.push({path: '/pipeline/params', query: { pipelineid: this.pipeline.id }})
367-
return
368+
if (this.pipeline.jobs) {
369+
for (let x = 0, y = this.pipeline.jobs.length; x < y; x++) {
370+
if (this.pipeline.jobs[x].args && this.pipeline.jobs[x].args.type !== 'vault') {
371+
// we found args. Redirect user to params view.
372+
this.$router.push({path: '/pipeline/params', query: { pipelineid: this.pipeline.id }})
373+
return
374+
}
368375
}
369376
}
370377

0 commit comments

Comments
 (0)