From 1f4d958931a6fa64281d4c701a3bc082cddcc733 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 11 Dec 2022 10:52:27 +0100 Subject: [PATCH] MDT: fix import after update --- .../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 1de834263e..548fad8665 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 @@ -66,8 +66,11 @@ class PumpSyncStorage @Inject constructor( if (jsonData.isNotBlank()) { @Suppress("UNCHECKED_CAST") - pumpSyncStorageTBR = xstream.fromXML(jsonData, MutableList::class.java) as - MutableList + pumpSyncStorageTBR = try { + xstream.fromXML(jsonData, MutableList::class.java) as MutableList + } catch (e: Exception) { + mutableListOf() + } aapsLogger.debug(LTag.PUMP, "Loading Pump Sync Storage: tbrs=${pumpSyncStorageTBR.size}.") aapsLogger.debug(LTag.PUMP, "DD: PumpSyncStorageTBR=$pumpSyncStorageTBR")