Skip to content

Commit

Permalink
Merge pull request #4577 from hashicorp/b-panic-job-history
Browse files Browse the repository at this point in the history
Fix for panic when submitting non-existent version for job history CLI command
  • Loading branch information
chelseakomlo authored Aug 14, 2018
2 parents a24dd6d + 1ec0852 commit 49e96e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions command/job_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 49e96e0

Please sign in to comment.