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;
|
let logging = self.log_state_change;
|
||||||
|
|
||||||
Ok(Box::new(move || {
|
Ok(Box::new(move || {
|
||||||
Self::_set_state(
|
if let Some(current) = weak_current_state.upgrade() {
|
||||||
weak_state.as_ref().map(|w| w.upgrade()).flatten(),
|
Self::_set_state(
|
||||||
&mut *weak_current_state.upgrade().unwrap().lock().unwrap(),
|
weak_state.as_ref().map(|w| w.upgrade()).flatten(),
|
||||||
gui_handler.as_ref().map(|h| h.upgrade()).flatten(),
|
&mut *current.lock().unwrap(),
|
||||||
logging,
|
gui_handler.as_ref().map(|h| h.upgrade()).flatten(),
|
||||||
)
|
logging,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue