Couldn't reproduce it but on server parsing balance time sometimes failed

This commit is contained in:
dankito 2021-04-17 01:53:04 +02:00
parent ce3247c7e4
commit ec85162e00
1 changed files with 8 additions and 6 deletions

View File

@ -680,12 +680,14 @@ open class ResponseParser(
date = parseDate(dataElements[++dateIndex]) date = parseDate(dataElements[++dateIndex])
} }
return Balance( var time: Date? = null
parseAmount(dataElements[1], isCredit), if (dataElements.size > dateIndex + 1) {
currency, try {
date, time = parseTime(dataElements[dateIndex + 1])
if (dataElements.size > dateIndex + 1) parseTime(dataElements[dateIndex + 1]) else null } catch (e: Exception) { log.error("Could not parse balance time '${dataElementGroup[dateIndex + 1]}' of data element group: $dataElementGroup") }
) }
return Balance(parseAmount(dataElements[1], isCredit), currency, date, time)
} }
protected open fun parseIsCredit(isCredit: String): Boolean { protected open fun parseIsCredit(isCredit: String): Boolean {