From 0caf4e475c05b838027eded0fe934a79fc47c225 Mon Sep 17 00:00:00 2001 From: Avinash Sharma Date: Thu, 9 Jan 2025 22:05:45 +0530 Subject: [PATCH] synching: smoother synching (fixes #4981) --- .../main/java/org/ole/planet/myplanet/utilities/JsonUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/ole/planet/myplanet/utilities/JsonUtils.kt b/app/src/main/java/org/ole/planet/myplanet/utilities/JsonUtils.kt index 4386a99596..387f26b532 100644 --- a/app/src/main/java/org/ole/planet/myplanet/utilities/JsonUtils.kt +++ b/app/src/main/java/org/ole/planet/myplanet/utilities/JsonUtils.kt @@ -107,7 +107,7 @@ object JsonUtils { return try { if (jsonObject?.has(fieldName) == true) { val el: JsonElement = jsonObject.get(fieldName) - if (el is JsonNull) 0f else el.asFloat + if (el is JsonNull || el.asString.isEmpty()) 0f else el.asFloat } else { getInt(fieldName, jsonObject).toFloat() }