osbuild2: Don't add nil stages
Do nothing if a nil value is passed to pipeline.AddStage(). Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
This commit is contained in:
parent
67ae1acafd
commit
38e88daea6
1 changed files with 4 additions and 1 deletions
|
|
@ -30,6 +30,9 @@ func (p *Pipeline) SetBuild(build string) {
|
|||
|
||||
// AddStage appends a stage to the list of stages of a pipeline. The stages
|
||||
// will be executed in the order they are appended.
|
||||
// If the argument is nil, it is not added.
|
||||
func (p *Pipeline) AddStage(stage *Stage) {
|
||||
p.Stages = append(p.Stages, stage)
|
||||
if stage != nil {
|
||||
p.Stages = append(p.Stages, stage)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue