diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificateRequestPageController.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificateRequestPageController.java index 5959d29e..199a1511 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificateRequestPageController.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificateRequestPageController.java @@ -261,16 +261,19 @@ public class CertificateRequestPageController extends PageController sharedCertificates = getCertificateByBoardSN( - certificateType, - platformCertificate.getPlatformSerial(), - certificateManager); + if (platformCertificate.isBase()) { + // only do this if the base is being deleted. + List sharedCertificates = getCertificateByBoardSN( + certificateType, + platformCertificate.getPlatformSerial(), + certificateManager); - if (sharedCertificates != null) { - for (PlatformCredential pc : sharedCertificates) { - if (!pc.isBase()) { - pc.archive(); - certificateManager.update(pc); + if (sharedCertificates != null) { + for (PlatformCredential pc : sharedCertificates) { + if (!pc.isBase()) { + pc.archive(); + certificateManager.update(pc); + } } } }