From ed6858bee7708766912d9c96e41335fa7801933b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 8 Dec 2022 11:46:32 +0100 Subject: [PATCH] MDT: fix crash caused by code changes --- .../info/nightscout/pump/common/sync/PumpSyncStorage.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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")