diff --git a/command/job_history.go b/command/job_history.go index ba55d67bcb2..73508ac22de 100644 --- a/command/job_history.go +++ b/command/job_history.go @@ -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),