From 6c3863f0969ac5547dc50c60cb0f87c4ae2f2738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 25 May 2020 14:58:06 +0200 Subject: [PATCH] base: Don't unwrap when creating the olm machine. --- matrix_sdk_base/src/client.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matrix_sdk_base/src/client.rs b/matrix_sdk_base/src/client.rs index 254c79fc..6f79c4e4 100644 --- a/matrix_sdk_base/src/client.rs +++ b/matrix_sdk_base/src/client.rs @@ -59,7 +59,7 @@ use crate::identifiers::DeviceId; #[cfg(not(target_arch = "wasm32"))] use crate::JsonStore; #[cfg(feature = "encryption")] -use matrix_sdk_crypto::{CryptoStore, OlmMachine, OneTimeKeys}; +use matrix_sdk_crypto::{CryptoStore, OlmError, OlmMachine, OneTimeKeys}; pub type Token = String; @@ -437,7 +437,7 @@ impl BaseClient { store, ) .await - .unwrap(), + .map_err(OlmError::from)?, ); } else if let Some(path) = self.store_path.as_ref() { #[cfg(feature = "sqlite-cryptostore")] @@ -450,7 +450,7 @@ impl BaseClient { &self.store_passphrase, ) .await - .unwrap(), + .map_err(OlmError::from)?, ); } #[cfg(not(feature = "sqlite-cryptostore"))]