Skip to content

Commit

Permalink
sync: smoother json (fixes #4981) (#4983)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Avinash-Codes and dogi authored Jan 17, 2025
1 parent b32cc6f commit 971385e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 26
targetSdkVersion 34
versionCode 2213
versionName "0.22.13"
versionCode 2214
versionName "0.22.14"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ object JsonUtils {
return try {
if (jsonObject?.has(fieldName) == true) {
val el: JsonElement = jsonObject.get(fieldName)
if (el is JsonNull) 0 else el.asInt
if (el is JsonNull || el.asString.isEmpty()) 0 else el.asInt
} else {
0
}
Expand All @@ -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()
}
Expand Down

0 comments on commit 971385e

Please sign in to comment.