From e9a17ec8997099eaf391f30f00bc0fe4c8c95e61 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Tue, 13 Jul 2021 15:53:35 +0200 Subject: [PATCH] added check to verify not to add void APC --- .../eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java index 1a4e7c42a..47baee30d 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java @@ -426,10 +426,15 @@ public class ResultMapper implements Serializable { Optional> oPca = Optional.ofNullable(i.getProcessingchargeamount()); Optional> oPcc = Optional.ofNullable(i.getProcessingchargecurrency()); if (oPca.isPresent() && oPcc.isPresent()) { - APC apc = new APC(); - apc.setCurrency(oPcc.get().getValue()); - apc.setAmount(oPca.get().getValue()); - instance.setArticleprocessingcharge(apc); + Field pca = oPca.get(); + Field pcc = oPcc.get(); + if(!pca.getValue().trim().equals("") && !pcc.getValue().trim().equals("")){ + APC apc = new APC(); + apc.setCurrency(oPcc.get().getValue()); + apc.setAmount(oPca.get().getValue()); + instance.setArticleprocessingcharge(apc); + } + } }