From 5cc637c524ba12f16bd924e4d2e94bc1e0935d6d Mon Sep 17 00:00:00 2001 From: Sacha Al Himdani Date: Mon, 26 May 2025 12:18:00 -0700 Subject: [PATCH] Fix vendor update Signed-off-by: Sacha Al Himdani --- pkg/probo/vendor_service.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pkg/probo/vendor_service.go b/pkg/probo/vendor_service.go index e4b518ce4..657d4c142 100644 --- a/pkg/probo/vendor_service.go +++ b/pkg/probo/vendor_service.go @@ -197,21 +197,19 @@ func (s VendorService) Update( vendor.TrustPageURL = req.TrustPageURL } - businessOwner := &coredata.People{} - if err := businessOwner.LoadByID(ctx, conn, s.svc.scope, *req.BusinessOwnerID); err != nil { - return fmt.Errorf("cannot load business owner: %w", err) - } - if req.BusinessOwnerID != nil { + businessOwner := &coredata.People{} + if err := businessOwner.LoadByID(ctx, conn, s.svc.scope, *req.BusinessOwnerID); err != nil { + return fmt.Errorf("cannot load business owner: %w", err) + } vendor.BusinessOwnerID = &businessOwner.ID } - securityOwner := &coredata.People{} - if err := securityOwner.LoadByID(ctx, conn, s.svc.scope, *req.SecurityOwnerID); err != nil { - return fmt.Errorf("cannot load security owner: %w", err) - } - if req.SecurityOwnerID != nil { + securityOwner := &coredata.People{} + if err := securityOwner.LoadByID(ctx, conn, s.svc.scope, *req.SecurityOwnerID); err != nil { + return fmt.Errorf("cannot load security owner: %w", err) + } vendor.SecurityOwnerID = &securityOwner.ID }