don't crash if the pumper thread can't send a redraw poll

This commit is contained in:
bunnie 2022-08-11 02:48:38 +08:00
parent e824334747
commit b39ec5d044

View file

@ -151,10 +151,10 @@ pub(crate) fn pumper(mode: Arc<Mutex<VaultMode>>, sid: xous::SID, main_conn: xou
log::trace!("{:?}", opcode);
match opcode {
Some(PumpOp::Pump) => {
send_message(main_conn,
try_send_message(main_conn,
Message::new_scalar(crate::VaultOp::Redraw.to_usize().unwrap(),
0, 0, 0, 0)
).expect("couldn't pump redraw");
).ok(); // don't panic if the queue overflows
let mode_cache = {(*mode.lock().unwrap()).clone()};
{ // we really want mode.lock() to be in a different scope so...
if mode_cache == VaultMode::Totp {