Skip to content

Commit

Permalink
Convert null values to JsonNull (#15)
Browse files Browse the repository at this point in the history
If we don't handle null values explicitly, they end up in the `else` case and are converted to strings, which ends up with null values being sent as "null" strings
  • Loading branch information
NiallSmyth authored Sep 27, 2024
1 parent 8c3fcf7 commit 93d7739
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class AppsFlyerDestination(

private fun convertToPrimitive(value: Any?): JsonElement {
return when (value) {
null -> JsonNull
is Boolean -> JsonPrimitive(value)
is Number -> JsonPrimitive(value)
is String -> JsonPrimitive(value)
Expand Down

0 comments on commit 93d7739

Please sign in to comment.