Merge pull request #314 from sgotti/fix_cmd_run_list_panic_on_nil_task_exit_status

cmd: fix run list panic on task with nil exit status
This commit is contained in:
Simone Gotti 2022-02-28 23:22:56 +01:00 committed by GitHub
commit 3c13ae7ba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ func printRuns(runs []*runDetails) {
fmt.Printf("\t\tfailed to retrieve task information: %v\n", task.retrieveError)
} else {
for n, step := range task.runTaskResponse.Steps {
if step.Phase.IsFinished() && step.Type == "run" {
if step.Phase.IsFinished() && step.Type == "run" && step.ExitStatus != nil {
fmt.Printf("\t\tStep: %d, Name: %s, Type: %s, Phase: %s, ExitStatus: %d\n", n, step.Name, step.Type, step.Phase, *step.ExitStatus)
} else {
fmt.Printf("\t\tStep: %d, Name: %s, Type: %s, Phase: %s\n", n, step.Name, step.Type, step.Phase)