From 332c90a9e073938507977cfbec945a8f4300ff0d Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 20 Sep 2020 16:00:39 +0200 Subject: [PATCH] Fixed that response.errorsToShowToUser got mapped to an empty string instead of null if response.errorsToShowToUser is empty --- .../kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt b/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt index 91b9941f..5939f098 100644 --- a/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt +++ b/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt @@ -63,7 +63,8 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) { open fun mapErrorToShowToUser(response: FinTsClientResponse): String? { val errorMessage = response.errorMessage - return errorMessage ?: response.errorsToShowToUser.joinToString("\n") // TODO: find a better way to choose which of these error messages to show + return errorMessage ?: + if (response.errorsToShowToUser.isEmpty()) null else response.errorsToShowToUser.joinToString("\n") // TODO: find a better way to choose which of these error messages to show }