Remove expect on session deserialization failure

This commit is contained in:
Pierre HUBERT 2022-04-02 16:02:07 +02:00
parent 1070d80553
commit ad58d2de7e

View File

@ -46,7 +46,14 @@ impl<'a> SessionIdentity<'a> {
let mut res: Option<SessionIdentityData> = self.0.identity() let mut res: Option<SessionIdentityData> = self.0.identity()
.as_deref() .as_deref()
.map(serde_json::from_str) .map(serde_json::from_str)
.map(|f| f.expect("Failed to deserialize session data!")); .map(|f| match f {
Ok(d) => Some(d),
Err(e) => {
log::warn!("Failed to deserialize session data! {:?}", e);
None
}
})
.unwrap_or(None);
// Check if session is valid // Check if session is valid
if let Some(sess) = &res { if let Some(sess) = &res {