catch error behavior of bincode deserializer
This commit is contained in:
parent
6e2ed0f587
commit
4bb7fea2de
@ -190,7 +190,7 @@ impl MathApp {
|
|||||||
|
|
||||||
if commit == build::SHORT_COMMIT {
|
if commit == build::SHORT_COMMIT {
|
||||||
tracing::info!("Reading previous function data");
|
tracing::info!("Reading previous function data");
|
||||||
let function_manager: FunctionManager = unsafe { bincode::deserialize(&func_data).unwrap_unchecked() };
|
let function_manager: FunctionManager = bincode::deserialize(&func_data).ok()?;
|
||||||
return Some(function_manager);
|
return Some(function_manager);
|
||||||
} else {
|
} else {
|
||||||
tracing::info!("Previous functions are invalid due to differing commits (build: {}, previous: {})", build::SHORT_COMMIT, commit);
|
tracing::info!("Previous functions are invalid due to differing commits (build: {}, previous: {})", build::SHORT_COMMIT, commit);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user