Skip to content

Commit

Permalink
fix(android): map null values by checking JSONObject.NULL (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-horodyski committed Apr 26, 2024
1 parent 4902bca commit 887937a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ internal fun JSONObject.toReactMap(): ReadableMap =
is Int -> map.putInt(key, value)
is Double -> map.putDouble(key, value)
is String -> map.putString(key, value)
null -> map.putNull(key)
null, JSONObject.NULL -> map.putNull(key)
else -> map.putString(key, value.toString())
}
} catch (_: JSONException) {
Expand All @@ -201,7 +201,7 @@ private fun JSONArray.toReactArray(): ReadableArray =
is Int -> array.pushInt(value)
is Double -> array.pushDouble(value)
is String -> array.pushString(value)
null -> array.pushNull()
null, JSONObject.NULL -> array.pushNull()
else -> array.pushString(value.toString())
}
} catch (_: JSONException) {
Expand Down

0 comments on commit 887937a

Please sign in to comment.