From 7408e0ddf3fb4d70c64b8c417bf3d65810a8a94c Mon Sep 17 00:00:00 2001 From: Sascha Schwarze Date: Mon, 4 Nov 2024 11:45:15 +0100 Subject: [PATCH] Fix a nil pointer access Signed-off-by: Sascha Schwarze --- test/e2e/v1alpha1/common_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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