diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncStorage.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncStorage.kt index b481e1c3b0..1de834263e 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncStorage.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncStorage.kt @@ -50,8 +50,11 @@ class PumpSyncStorage @Inject constructor( if (jsonData.isNotBlank()) { @Suppress("UNCHECKED_CAST") - pumpSyncStorageBolus = xstream.fromXML(jsonData, MutableList::class.java) as - MutableList + pumpSyncStorageBolus = try { + xstream.fromXML(jsonData, MutableList::class.java) as MutableList + } catch (e: Exception) { + mutableListOf() + } aapsLogger.debug(LTag.PUMP, "Loading Pump Sync Storage Bolus: boluses=${pumpSyncStorageBolus.size}") aapsLogger.debug(LTag.PUMP, "DD: PumpSyncStorageBolus=$pumpSyncStorageBolus")