From 8b5608ac7c5a4493f101fb489e66401a834f3312 Mon Sep 17 00:00:00 2001 From: Felix Dittrich Date: Tue, 11 May 2021 13:02:04 +0200 Subject: [PATCH] Add Null Check at Certificate Download --- .../ec/dgc/gateway/connector/DgcGatewayDownloadConnector.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayDownloadConnector.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayDownloadConnector.java index a407df6..8371bb2 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayDownloadConnector.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/DgcGatewayDownloadConnector.java @@ -214,6 +214,10 @@ private boolean checkUploadCertificate(TrustListItemDto trustListItem) { new SignedCertificateMessageParser(trustListItem.getSignature(), trustListItem.getRawData()); X509CertificateHolder uploadCertificate = parser.getSigningCertificate(); + if (uploadCertificate == null) { + return false; + } + return trustedUploadCertificates .stream() .anyMatch(uploadCertificate::equals);