diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt index 79770a02..5fa3992d 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/mapper/ModelMapper.kt @@ -81,10 +81,9 @@ open class ModelMapper( } response.getSegmentsById(InstituteSegmentId.AccountInfo).forEach { accountInfo -> - var accountHolderName = accountInfo.accountHolderName1 - accountInfo.accountHolderName2?.let { - accountHolderName += it // TODO: add a whitespace in between? - } + val accountHolderName = if (accountInfo.accountHolderName2.isNullOrBlank()) accountInfo.accountHolderName1.trim() // Baader Bank adds a lot of white spaces at end + else accountInfo.accountHolderName1.trim() + " " + accountInfo.accountHolderName2.trim() + bank.customerName = accountHolderName findExistingAccount(bank, accountInfo)?.let { account ->