diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCode.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCode.kt index 0d43519f..2d27fbfc 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCode.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCode.kt @@ -3,12 +3,12 @@ package net.codinux.banking.fints.tan open class FlickerCode( val challengeHHD_UC: String, - val parsedDataSet: String, + val parsedDataSet: String? = null, val decodingError: Exception? = null ) { val decodingSuccessful: Boolean - get() = decodingError == null + get() = parsedDataSet != null override fun toString(): String { diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCodeDecoder.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCodeDecoder.kt index b5db757f..2237fecb 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCodeDecoder.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/FlickerCodeDecoder.kt @@ -45,7 +45,7 @@ open class FlickerCodeDecoder { } catch (e: Exception) { log.error(e) { "Could not decode challenge $challengeHHD_UC" } - return FlickerCode(challengeHHD_UC, "", e) + return FlickerCode(challengeHHD_UC, null, e) } } diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/TanImage.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/TanImage.kt index 819ee46d..322a7e26 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/TanImage.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/TanImage.kt @@ -2,13 +2,13 @@ package net.codinux.banking.fints.tan open class TanImage( - val mimeType: String, - val imageBytes: ByteArray, + val mimeType: String? = null, + val imageBytes: ByteArray? = null, val decodingError: Exception? = null ) { val decodingSuccessful: Boolean - get() = decodingError == null + get() = mimeType != null && imageBytes != null override fun toString(): String { @@ -16,7 +16,7 @@ open class TanImage( return "Decoding error: $decodingError" } - return "$mimeType ${imageBytes.size} bytes" + return "$mimeType ${imageBytes?.size} bytes" } } \ No newline at end of file diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/TanImageDecoder.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/TanImageDecoder.kt index 8d3b533c..0fe3311c 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/TanImageDecoder.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/tan/TanImageDecoder.kt @@ -29,7 +29,7 @@ open class TanImageDecoder { } catch (e: Exception) { log.error(e) { "Could not decode challenge HHD_UC to TanImage: $challengeHHD_UC" } - return TanImage("", ByteArray(0), e) + return TanImage(null, null, e) } }