diff --git a/pkg/apis/pipeline/v1alpha1/taskrun_defaults.go b/pkg/apis/pipeline/v1alpha1/taskrun_defaults.go index d4a74e37e77..9f36349ba10 100644 --- a/pkg/apis/pipeline/v1alpha1/taskrun_defaults.go +++ b/pkg/apis/pipeline/v1alpha1/taskrun_defaults.go @@ -21,7 +21,7 @@ func (tr *TaskRun) SetDefaults() { } func (trs *TaskRunSpec) SetDefaults() { - if trs.TaskRef.Kind == "" { + if trs.TaskRef != nil && trs.TaskRef.Kind == "" { trs.TaskRef.Kind = NamespacedTaskKind } }