From 95ab17a13f8979f29cc8cdb30f24ec1e2c7c5457 Mon Sep 17 00:00:00 2001 From: Niall Smyth Date: Fri, 27 Sep 2024 17:29:45 +0100 Subject: [PATCH] Convert null values to JsonNull 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 --- .../kotlin/destinations/appsflyer/AppsflyerDestination.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/main/java/com/segment/analytics/kotlin/destinations/appsflyer/AppsflyerDestination.kt b/lib/src/main/java/com/segment/analytics/kotlin/destinations/appsflyer/AppsflyerDestination.kt index d4c29fb..a26c13a 100644 --- a/lib/src/main/java/com/segment/analytics/kotlin/destinations/appsflyer/AppsflyerDestination.kt +++ b/lib/src/main/java/com/segment/analytics/kotlin/destinations/appsflyer/AppsflyerDestination.kt @@ -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)