Skip to content

Commit 7408e0d

Browse files
Fix a nil pointer access
Signed-off-by: Sascha Schwarze <schwarzs@de.ibm.com>
1 parent c9b8280 commit 7408e0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/e2e/v1alpha1/common_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func printTestFailureDebugInfo(testBuild *utils.TestBuild, namespace string, bui
255255
func GetBuildObject(ctx context.Context, client client.Client, buildRun *buildv1alpha1.BuildRun, build *buildv1alpha1.Build) error {
256256
// Option #1: BuildRef is specified
257257
// An actual Build resource is specified by name and needs to be looked up in the cluster.
258-
if buildRun.Spec.BuildRef.Name != "" {
258+
if buildRun.Spec.BuildRef != nil && buildRun.Spec.BuildRef.Name != "" {
259259
err := client.Get(ctx, types.NamespacedName{Name: buildRun.Spec.BuildName(), Namespace: buildRun.Namespace}, build)
260260
if apierrors.IsNotFound(err) {
261261
// stop reconciling and mark the BuildRun as Failed

0 commit comments

Comments
 (0)