Fixed that when fintsBank could not get restored and then addAccount() fails (e.g. due to no network connection), then fintsBank contains almost no data which then got mapped to bank

This commit is contained in:
dankito 2020-09-30 02:41:05 +02:00
parent 69375602e3
commit 26e03137cd
1 changed files with 4 additions and 1 deletions

View File

@ -67,7 +67,10 @@ open class fints4kBankingClient(
protected open fun handleAddAccountResponse(response: net.dankito.banking.fints.response.client.AddAccountResponse, protected open fun handleAddAccountResponse(response: net.dankito.banking.fints.response.client.AddAccountResponse,
callback: (AddAccountResponse) -> Unit) { callback: (AddAccountResponse) -> Unit) {
if (response.successful) { // if fintsBank couldn't be restored and then an error occurs, e.g. no network connection, then fintsBank contains almost no data which then gets mapped to bank -> accounts, TAN methods, TAN procedures, ... are lost
mapper.mapBank(bank, fintsBank) mapper.mapBank(bank, fintsBank)
}
val mappedResponse = mapper.mapResponse(bank, response) val mappedResponse = mapper.mapResponse(bank, response)
saveData() saveData()