From 034bf3ecd8ccb067e97a1c25d7fc9ac6f80d0180 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 22 Dec 2019 22:52:26 +0100 Subject: [PATCH] fix parsing profile units --- .../main/java/info/nightscout/androidaps/data/ProfileStore.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/data/ProfileStore.kt b/app/src/main/java/info/nightscout/androidaps/data/ProfileStore.kt index ca48a72296..9415a25f2c 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/ProfileStore.kt +++ b/app/src/main/java/info/nightscout/androidaps/data/ProfileStore.kt @@ -47,7 +47,7 @@ class ProfileStore(val data: JSONObject) { if (profile == null) { JsonHelper.safeGetJSONObject(store, profileName, null)?.let { profileObject -> // take units from profile and if N/A from store - JsonHelper.safeGetStringAllowNull(profileObject, "units", JsonHelper.safeGetString(store, "units"))?.let { units -> + JsonHelper.safeGetStringAllowNull(profileObject, "units", JsonHelper.safeGetString(data, "units"))?.let { units -> profile = Profile(profileObject, units) cachedObjects[profileName] = profile }