From c40df00699850da85765b630310dc3a33cebeb66 Mon Sep 17 00:00:00 2001 From: Mpendulo Ndlovu Date: Wed, 17 Jul 2024 12:36:44 +0200 Subject: [PATCH] chore: satinise batch request response to remove null values --- .../main/java/io/metamask/androidsdk/CommunicationClient.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/metamask-android-sdk/src/main/java/io/metamask/androidsdk/CommunicationClient.kt b/metamask-android-sdk/src/main/java/io/metamask/androidsdk/CommunicationClient.kt index 9dadb3d4..5bea4220 100644 --- a/metamask-android-sdk/src/main/java/io/metamask/androidsdk/CommunicationClient.kt +++ b/metamask-android-sdk/src/main/java/io/metamask/androidsdk/CommunicationClient.kt @@ -300,8 +300,9 @@ internal class CommunicationClient(context: Context, callback: EthereumEventCall } EthereumMethod.METAMASK_BATCH.value -> { val result = data.optString("result") - val results: List = Gson().fromJson(result, object : TypeToken>() {}.type) - completeRequest(id, Result.Success.Items(results)) + val results: List = Gson().fromJson(result, object : TypeToken>() {}.type) + val sanitisedResults = results.filterNotNull() + completeRequest(id, Result.Success.Items(sanitisedResults)) } else -> { val result = data.optString("result")