Skip to content

Commit

Permalink
Merge pull request #1121 from eclipse-tractusx/feature/985-notificati…
Browse files Browse the repository at this point in the history
…on-contractagreements

feature(chore):985 fixed nullpointer
  • Loading branch information
ds-mwesener authored Jun 26, 2024
2 parents 3039796 + b638bda commit 451a866
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

import static org.apache.commons.collections4.ListUtils.emptyIfNull;
Expand Down Expand Up @@ -107,7 +108,7 @@ public void saveAll(List<ContractAgreementEntity> contractAgreements) {
}

private List<Contract> fetchEdcContractAgreements(List<ContractAgreementEntity> contractAgreementEntities) throws ContractAgreementException {
List<String> contractAgreementIds = contractAgreementEntities.stream().map(ContractAgreementEntity::getContractAgreementId).toList();
List<String> contractAgreementIds = contractAgreementEntities.stream().filter(Objects::nonNull).map(ContractAgreementEntity::getContractAgreementId).toList();
log.info("Trying to fetch contractAgreementIds from EDC: " + contractAgreementIds);

List<EdcContractAgreementsResponse> contractAgreements = edcContractAgreementService.getContractAgreements(contractAgreementIds);
Expand Down

0 comments on commit 451a866

Please sign in to comment.