Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #691 from profclems/fix-segfault-ci-list
Browse files Browse the repository at this point in the history
Fix segfault on ci list
  • Loading branch information
profclems authored Apr 26, 2021
2 parents 1ca6e79 + 2bade26 commit 35e792f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions commands/ci/ciutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ func DisplayMultiplePipelines(c *iostreams.ColorPalette, p []*gitlab.PipelineInf
if len(p) > 0 {

for _, pipeline := range p {
duration := utils.TimeToPrettyTimeAgo(*pipeline.CreatedAt)
duration := ""

if pipeline.CreatedAt != nil {
duration = c.Magenta("(" + utils.TimeToPrettyTimeAgo(*pipeline.CreatedAt) + ")")
}
var pipeState string
if pipeline.Status == "success" {
pipeState = c.Green(fmt.Sprintf("(%s) • #%d", pipeline.Status, pipeline.ID))
Expand All @@ -40,7 +44,7 @@ func DisplayMultiplePipelines(c *iostreams.ColorPalette, p []*gitlab.PipelineInf
pipeState = c.Gray(fmt.Sprintf("(%s) • #%d", pipeline.Status, pipeline.ID))
}

table.AddRow(pipeState, pipeline.Ref, c.Magenta("("+duration+")"))
table.AddRow(pipeState, pipeline.Ref, duration)
}

return table.Render()
Expand Down

0 comments on commit 35e792f

Please sign in to comment.