MDT: fix import after update

This commit is contained in:
Milos Kozak 2022-12-11 10:52:27 +01:00
parent 3a29e8d4f2
commit 1f4d958931

View file

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