Skip to content

Commit

Permalink
Fix a nil pointer access
Browse files Browse the repository at this point in the history
Signed-off-by: Sascha Schwarze <[email protected]>
  • Loading branch information
SaschaSchwarze0 committed Nov 4, 2024
1 parent c9b8280 commit 7408e0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/v1alpha1/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7408e0d

Please sign in to comment.