ensure nil step does not cause problems

This commit is contained in:
Brad Rydzewski
2019-10-17 15:52:05 -07:00
parent b198003a0c
commit 983f1badde
6 changed files with 26 additions and 1 deletions

View File

@@ -39,6 +39,9 @@ func lint(pipeline *Pipeline) error {
// ensure pipeline steps are not unique.
names := map[string]struct{}{}
for _, step := range pipeline.Steps {
if step == nil {
return errors.New("Linter: detected nil step")
}
if step.Name == "" {
return errors.New("Linter: invalid or missing step name")
}