Not validating task groups if it's nil in a job

This commit is contained in:
Diptanu Choudhury 2015-10-30 21:43:00 -07:00
parent c80f0e38d1
commit 9139777ab7
1 changed files with 4 additions and 2 deletions

View File

@ -974,8 +974,10 @@ func (tg *TaskGroup) Validate() error {
}
}
if err := tg.RestartPolicy.Validate(); err != nil {
mErr.Errors = append(mErr.Errors, err)
if tg.RestartPolicy != nil {
if err := tg.RestartPolicy.Validate(); err != nil {
mErr.Errors = append(mErr.Errors, err)
}
}
// Check for duplicate tasks