Fix UnsupportedOperationException in buildNotes

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
Jan N. Klug
2024-09-11 09:22:51 +02:00
parent 958d268cac
commit f280cf0589

View File

@@ -864,8 +864,9 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
}
protected String buildNotes(IExportableTransaction exportableTransaction) {
final List<IncludedNote> includedNotes = Optional.ofNullable(exportableTransaction.getNotesWithSubjectCode())
.orElse(new ArrayList<>());
final List<IncludedNote> includedNotes = new ArrayList<>();
Optional.ofNullable(exportableTransaction.getNotesWithSubjectCode()).ifPresent(includedNotes::addAll);
if (exportableTransaction.getNotes() != null) {
for (final String currentNote : exportableTransaction.getNotes()) {
includedNotes.add(IncludedNote.unspecifiedNote(currentNote));