Don't error out if weak handle isn't present
This commit is contained in:
parent
e20c42925b
commit
a50ef55ad4
1 changed files with 10 additions and 6 deletions
|
@ -356,12 +356,16 @@ impl States {
|
|||
let logging = self.log_state_change;
|
||||
|
||||
Ok(Box::new(move || {
|
||||
if let Some(current) = weak_current_state.upgrade() {
|
||||
Self::_set_state(
|
||||
weak_state.as_ref().map(|w| w.upgrade()).flatten(),
|
||||
&mut *weak_current_state.upgrade().unwrap().lock().unwrap(),
|
||||
&mut *current.lock().unwrap(),
|
||||
gui_handler.as_ref().map(|h| h.upgrade()).flatten(),
|
||||
logging,
|
||||
)
|
||||
)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue