Merge pull request #4577 from hashicorp/b-panic-job-history

Fix for panic when submitting non-existent version for job history CLI command
This commit is contained in:
Chelsea Komlo
2018-08-14 17:34:05 -04:00
committed by GitHub

View File

@@ -248,6 +248,10 @@ func (c *JobHistoryCommand) formatJobVersions(versions []*api.Job, diffs []*api.
}
func (c *JobHistoryCommand) formatJobVersion(job *api.Job, diff *api.JobDiff, nextVersion uint64, full bool) error {
if job == nil {
return fmt.Errorf("Error printing job history for non-existing job or job version")
}
basic := []string{
fmt.Sprintf("Version|%d", *job.Version),
fmt.Sprintf("Stable|%v", *job.Stable),