diff --git a/commands/ci/status/status.go b/commands/ci/status/status.go index edc2344c..d58de3e7 100644 --- a/commands/ci/status/status.go +++ b/commands/ci/status/status.go @@ -85,7 +85,12 @@ func NewCmdStatus(f *cmdutils.Factory) *cobra.Command { if job.FinishedAt != nil { end = *job.FinishedAt } - duration := utils.FmtDuration(end.Sub(*job.StartedAt)) + var duration string + if job.StartedAt != nil { + duration = utils.FmtDuration(end.Sub(*job.StartedAt)) + } else { + duration = "not started" + } var status string switch s := job.Status; s { case "failed":