From 1c40c6c4f876c7913f45e7b0fa13f9cc1fdbe728 Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Mon, 24 Jun 2024 14:14:27 -0500 Subject: [PATCH] Sanitize address before inbox ID lookup --- xmtp_mls/src/client.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xmtp_mls/src/client.rs b/xmtp_mls/src/client.rs index c3787187d..28a18ac19 100644 --- a/xmtp_mls/src/client.rs +++ b/xmtp_mls/src/client.rs @@ -270,8 +270,15 @@ where &self, address: String, ) -> Result, ClientError> { - let mut results = self.api_client.get_inbox_ids(vec![address.clone()]).await?; - Ok(results.remove(&address)) + if let Some(sanitized_address) = sanitize_evm_addresses(vec![address])?.pop() { + let mut results = self + .api_client + .get_inbox_ids(vec![sanitized_address.clone()]) + .await?; + Ok(results.remove(&sanitized_address)) + } else { + Ok(None) + } } /// Get sequence id, may not be consistent with the backend