From 14cc2b5607a834c4f060cead4b417f3dc97bd155 Mon Sep 17 00:00:00 2001 From: Mo Mustafa <96316894+mmustafa-tse@users.noreply.github.com> Date: Mon, 1 May 2023 07:13:03 -0700 Subject: [PATCH] fix:data plan blocking app crashes (#368) Co-authored-by: markvdouw --- .../src/main/kotlin/com/mparticle/kits/DataplanFilter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android-kit-base/src/main/kotlin/com/mparticle/kits/DataplanFilter.kt b/android-kit-base/src/main/kotlin/com/mparticle/kits/DataplanFilter.kt index 85a0da59f..9a8033da9 100644 --- a/android-kit-base/src/main/kotlin/com/mparticle/kits/DataplanFilter.kt +++ b/android-kit-base/src/main/kotlin/com/mparticle/kits/DataplanFilter.kt @@ -101,7 +101,7 @@ Data Plan parsed for Kit Filtering: if (event is CommerceEvent) { val productActionDatapoint = dataPoints["$dataPointKey.$PRODUCT_ACTION_PRODUCTS"] event.products?.iterator()?.forEach { product -> - product?.customAttributes?.apply { + product?.customAttributes?.toMutableMap()?.apply { val filteredAttributes = filterKeys { productActionDatapoint?.contains(it) ?: true } @@ -113,7 +113,7 @@ Data Plan parsed for Kit Filtering: if ((event.impressions?.size ?: 0) > 0) { event.impressions?.iterator()?.forEach { it.products.forEach { product -> - product?.customAttributes?.apply { + product?.customAttributes?.toMutableMap()?.apply { val filteredAttributes = filterKeys { productImpressionDatapoint?.contains(it) ?: true }