MDT: fix crash caused by code changes

This commit is contained in:
Milos Kozak 2022-12-08 11:46:32 +01:00
parent be647d8b5b
commit ed6858bee7

View file

@ -50,8 +50,11 @@ class PumpSyncStorage @Inject constructor(
if (jsonData.isNotBlank()) { if (jsonData.isNotBlank()) {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
pumpSyncStorageBolus = xstream.fromXML(jsonData, MutableList::class.java) as pumpSyncStorageBolus = try {
MutableList<PumpDbEntryBolus> xstream.fromXML(jsonData, MutableList::class.java) as MutableList<PumpDbEntryBolus>
} catch (e: Exception) {
mutableListOf()
}
aapsLogger.debug(LTag.PUMP, "Loading Pump Sync Storage Bolus: boluses=${pumpSyncStorageBolus.size}") aapsLogger.debug(LTag.PUMP, "Loading Pump Sync Storage Bolus: boluses=${pumpSyncStorageBolus.size}")
aapsLogger.debug(LTag.PUMP, "DD: PumpSyncStorageBolus=$pumpSyncStorageBolus") aapsLogger.debug(LTag.PUMP, "DD: PumpSyncStorageBolus=$pumpSyncStorageBolus")