crypto: Remove an unwrap from the sqlite cryptostore.

master
Damir Jelić 2020-09-02 12:17:38 +02:00
parent 8c4acf54e0
commit 8b56546565
2 changed files with 6 additions and 3 deletions

View File

@ -15,7 +15,7 @@
use std::{collections::HashSet, fmt::Debug, io::Error as IoError, sync::Arc}; use std::{collections::HashSet, fmt::Debug, io::Error as IoError, sync::Arc};
use matrix_sdk_common::{ use matrix_sdk_common::{
identifiers::{DeviceId, RoomId, UserId}, identifiers::{DeviceId, Error as IdentifierValidationError, RoomId, UserId},
locks::Mutex, locks::Mutex,
}; };
use matrix_sdk_common_macros::async_trait; use matrix_sdk_common_macros::async_trait;
@ -81,6 +81,10 @@ pub enum CryptoStoreError {
#[error(transparent)] #[error(transparent)]
SessionUnpickling(#[from] SessionUnpicklingError), SessionUnpickling(#[from] SessionUnpicklingError),
/// A Matirx identifier failed to be validated.
#[error(transparent)]
IdentifierValidation(#[from] IdentifierValidationError),
/// The store failed to (de)serialize a data type. /// The store failed to (de)serialize a data type.
#[error(transparent)] #[error(transparent)]
Serialization(#[from] SerdeError), Serialization(#[from] SerdeError),

View File

@ -398,8 +398,7 @@ impl SqliteStore {
pickle: InboundGroupSessionPickle::from(pickle), pickle: InboundGroupSessionPickle::from(pickle),
sender_key, sender_key,
signing_key, signing_key,
// FIXME remove this unwrap. room_id: RoomId::try_from(room_id)?,
room_id: RoomId::try_from(room_id).unwrap(),
}; };
Ok(InboundGroupSession::from_pickle( Ok(InboundGroupSession::from_pickle(