Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-v0.22.x] fix nil pointer dereference when taksrun is canceled #1246

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading