From d18e9398185387e5047ccdf66ff1035dc506cad2 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 21 Jul 2020 00:31:15 +0200 Subject: [PATCH] Fixed that erroneously an error got returned even though lastCreatedMessage was set --- .../kotlin/net/dankito/banking/fints/FinTsClient.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt index 19ff890d..6229f70c 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/FinTsClient.kt @@ -852,7 +852,7 @@ open class FinTsClient( protected open fun resendMessageInNewDialog(lastCreatedMessage: MessageBuilderResult?, previousDialogContext: DialogContext, callback: (Response) -> Unit) { - lastCreatedMessage?.let { // do not use previousDialogContext.currentMessage as this may is previous dialog's dialog close message + if (lastCreatedMessage != null) { // do not use previousDialogContext.currentMessage as this may is previous dialog's dialog close message val newDialogContext = DialogContext(previousDialogContext.bank, previousDialogContext.customer, previousDialogContext.product, chunkedResponseHandler = previousDialogContext.chunkedResponseHandler) initDialog(newDialogContext) { initDialogResponse -> @@ -870,9 +870,10 @@ open class FinTsClient( } } } - - val errorMessage = "There's no last action (like retrieve account transactions, transfer money, ...) to re-send with new TAN procedure. Probably an internal programming error." // TODO: translate - callback(Response(false, exception = Exception(errorMessage))) // should never come to this + else { + val errorMessage = "There's no last action (like retrieve account transactions, transfer money, ...) to re-send with new TAN procedure. Probably an internal programming error." // TODO: translate + callback(Response(false, exception = Exception(errorMessage))) // should never come to this + } }