fix parsing profile units

This commit is contained in:
Milos Kozak 2019-12-22 22:52:26 +01:00
parent 60dce8fd15
commit 034bf3ecd8

View file

@ -47,7 +47,7 @@ class ProfileStore(val data: JSONObject) {
if (profile == null) { if (profile == null) {
JsonHelper.safeGetJSONObject(store, profileName, null)?.let { profileObject -> JsonHelper.safeGetJSONObject(store, profileName, null)?.let { profileObject ->
// take units from profile and if N/A from store // 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) profile = Profile(profileObject, units)
cachedObjects[profileName] = profile cachedObjects[profileName] = profile
} }