Remove expect on session deserialization failure
This commit is contained in:
parent
1070d80553
commit
ad58d2de7e
@ -46,7 +46,14 @@ impl<'a> SessionIdentity<'a> {
|
||||
let mut res: Option<SessionIdentityData> = self.0.identity()
|
||||
.as_deref()
|
||||
.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
|
||||
if let Some(sess) = &res {
|
||||
|
Loading…
Reference in New Issue
Block a user