Skip to content

Commit

Permalink
fix nil pointer dereference when taksrun is canceled
Browse files Browse the repository at this point in the history
  • Loading branch information
jkhelil authored and tekton-robot committed Nov 8, 2024
1 parent 1390c44 commit b487c3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/chains/formats/slsa/v1/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func buildConfig(ctx context.Context, pro *objects.PipelineRunObjectV1Beta1) Bui

steps := []attest.StepAttestation{}
// tr.Status.TaskSpec.Steps and tr.Status.Steps should be sime size
if len(tr.Status.TaskSpec.Steps) != len(tr.Status.Steps) {
if tr.Status.TaskSpec == nil || len(tr.Status.TaskSpec.Steps) != len(tr.Status.Steps) {
logger.Errorf("Mismatch in number of steps for task run %s. TaskSpec steps: %d, Status steps: %d",
tr.Name, len(tr.Status.TaskSpec.Steps), len(tr.Status.Steps))
continue // Skip this task run entirely
Expand Down

0 comments on commit b487c3d

Please sign in to comment.