diff --git a/rest/fints4kRest/src/main/kotlin/net/dankito/banking/fints/rest/service/fints4kService.kt b/rest/fints4kRest/src/main/kotlin/net/dankito/banking/fints/rest/service/fints4kService.kt index 676fc76d..dc56707e 100644 --- a/rest/fints4kRest/src/main/kotlin/net/dankito/banking/fints/rest/service/fints4kService.kt +++ b/rest/fints4kRest/src/main/kotlin/net/dankito/banking/fints/rest/service/fints4kService.kt @@ -117,7 +117,10 @@ class fints4kService { protected fun mapToBankData(accessData: BankAccessData): Pair { val bankSearchResult = bankFinder.findBankByBankCode(accessData.bankCode) val fintsServerAddress = accessData.finTsServerAddress ?: bankSearchResult.firstOrNull { it.pinTanAddress != null }?.pinTanAddress - val bank = BankData(accessData.bankCode, accessData.loginName, accessData.password, fintsServerAddress ?: "", bankSearchResult.firstOrNull()?.bic ?: "") + val potentialBankInfo = bankSearchResult.firstOrNull() + + val bank = BankData(accessData.bankCode, accessData.loginName, accessData.password, fintsServerAddress ?: "", + potentialBankInfo?.bic ?: "", potentialBankInfo?.name ?: "") if (fintsServerAddress == null) { val errorMessage = if (bankSearchResult.isEmpty()) "No bank found for bank code '${accessData.bankCode}'" else "Bank '${bankSearchResult.firstOrNull()?.name} does not support FinTS 3.0"