Skip to content

Commit

Permalink
Merge pull request #129 from MetaMask/batch-request-improvements
Browse files Browse the repository at this point in the history
chore: satinise batch request response to remove null values
  • Loading branch information
elefantel authored Jul 17, 2024
2 parents a1ad744 + c40df00 commit 1c91e8b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,9 @@ internal class CommunicationClient(context: Context, callback: EthereumEventCall
}
EthereumMethod.METAMASK_BATCH.value -> {
val result = data.optString("result")
val results: List<String> = Gson().fromJson(result, object : TypeToken<List<String>>() {}.type)
completeRequest(id, Result.Success.Items(results))
val results: List<String?> = Gson().fromJson(result, object : TypeToken<List<String?>>() {}.type)
val sanitisedResults = results.filterNotNull()
completeRequest(id, Result.Success.Items(sanitisedResults))
}
else -> {
val result = data.optString("result")
Expand Down

0 comments on commit 1c91e8b

Please sign in to comment.