We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 83d7620 + 971385e commit f0b09a0Copy full SHA for f0b09a0
app/src/main/java/org/ole/planet/myplanet/utilities/JsonUtils.kt
@@ -92,7 +92,7 @@ object JsonUtils {
92
return try {
93
if (jsonObject?.has(fieldName) == true) {
94
val el: JsonElement = jsonObject.get(fieldName)
95
- if (el is JsonNull) 0 else el.asInt
+ if (el is JsonNull || el.asString.isEmpty()) 0 else el.asInt
96
} else {
97
0
98
}
@@ -107,7 +107,7 @@ object JsonUtils {
107
108
109
110
- if (el is JsonNull) 0f else el.asFloat
+ if (el is JsonNull || el.asString.isEmpty()) 0f else el.asFloat
111
112
getInt(fieldName, jsonObject).toFloat()
113
0 commit comments