diff --git a/test/e2e/v1alpha1/common_test.go b/test/e2e/v1alpha1/common_test.go index 43111cecee..86ac8cf4b3 100644 --- a/test/e2e/v1alpha1/common_test.go +++ b/test/e2e/v1alpha1/common_test.go @@ -255,7 +255,7 @@ func printTestFailureDebugInfo(testBuild *utils.TestBuild, namespace string, bui func GetBuildObject(ctx context.Context, client client.Client, buildRun *buildv1alpha1.BuildRun, build *buildv1alpha1.Build) error { // Option #1: BuildRef is specified // An actual Build resource is specified by name and needs to be looked up in the cluster. - if buildRun.Spec.BuildRef.Name != "" { + if buildRun.Spec.BuildRef != nil && buildRun.Spec.BuildRef.Name != "" { err := client.Get(ctx, types.NamespacedName{Name: buildRun.Spec.BuildName(), Namespace: buildRun.Namespace}, build) if apierrors.IsNotFound(err) { // stop reconciling and mark the BuildRun as Failed