Skip to content

Commit 1694772

Browse files
committed
check for null completed times
1 parent a91d8aa commit 1694772

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

main.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,18 @@ func getSteps(ctx context.Context, conf actionConfig) error {
5454
}
5555
for _, step := range job.Steps {
5656
_, stepSpan := tracer.Start(ctx, *step.Name, trace.WithTimestamp(step.StartedAt.Time))
57-
stepSpan.End(trace.WithTimestamp(step.CompletedAt.Time))
57+
if step.CompletedAt != nil {
58+
stepSpan.End(trace.WithTimestamp(step.CompletedAt.Time))
59+
} else {
60+
stepSpan.End()
61+
}
5862
}
59-
jobSpan.End(trace.WithTimestamp(job.CompletedAt.Time))
63+
if job.CompletedAt != nil {
64+
jobSpan.End(trace.WithTimestamp(job.CompletedAt.Time))
65+
} else {
66+
jobSpan.End()
67+
}
68+
6069
}
6170

6271
return nil

0 commit comments

Comments
 (0)