Input source: Update monado devices only if they are available
Fixes .unwrap() panic in the simulated Monado driver
This commit is contained in:
@@ -212,8 +212,10 @@ pub fn openxr_run(running: Arc<AtomicBool>, show_by_default: bool) -> Result<(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
if next_device_update <= Instant::now() {
|
if next_device_update <= Instant::now() {
|
||||||
input_source.update_devices(&mut app_state, monado.as_mut().unwrap());
|
if let Some(monado) = &mut monado {
|
||||||
next_device_update = Instant::now() + Duration::from_secs(30);
|
input_source.update_devices(&mut app_state, monado);
|
||||||
|
next_device_update = Instant::now() + Duration::from_secs(30);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !session_running {
|
if !session_running {
|
||||||
|
|||||||
Reference in New Issue
Block a user