added check to fix issue when entry is present but value it is not

This commit is contained in:
Miriam Baglioni 2020-06-22 17:37:30 +02:00
parent b570f011d1
commit e983d02c1c
1 changed files with 3 additions and 1 deletions

View File

@ -99,7 +99,9 @@ public class Mapper implements Serializable {
.ofNullable(input.getDescription())
.ifPresent(value -> {
Iterator<Field<String>> it = value.iterator();
out.setName(it.next().getValue());
if (it.hasNext()) {
out.setName(it.next().getValue());
}
it.forEachRemaining(v -> externals.add(KeyValue.newInstance("description", v.getValue())));
});