added code to handle cases where the funding tree is not existing

This commit is contained in:
Miriam Baglioni 2020-10-27 16:15:21 +01:00
parent 5d3012eeb4
commit d2374e3b9e
1 changed files with 25 additions and 20 deletions

View File

@ -135,12 +135,17 @@ public class SparkPrepareResultProject implements Serializable {
.orElse(null),
Optional
.ofNullable(op.getFundingtree())
.map(
value -> value
.map(value -> {
List<Funder> tmp = value
.stream()
.map(ft -> getFunder(ft.getValue()))
.collect(Collectors.toList())
.get(0))
.collect(Collectors.toList());
if (tmp.size() > 0) {
return tmp.get(0);
} else {
return null;
}
})
.orElse(null));
Optional<DataInfo> di = Optional.ofNullable(op.getDataInfo());