fix: crash when a sink input was removed
This commit is contained in:
10
src/mixer.rs
10
src/mixer.rs
@@ -238,12 +238,9 @@ impl Mixer {
|
||||
Some(current_index) => {
|
||||
drop(selected_index_lock);
|
||||
|
||||
let removed_sink_input_index = self
|
||||
.sink_inputs
|
||||
.keys()
|
||||
.position(|k| *k == sink_index)
|
||||
.unwrap();
|
||||
|
||||
if let Some(removed_sink_input_index) =
|
||||
self.sink_inputs.keys().position(|k| *k == sink_index)
|
||||
{
|
||||
let current_key =
|
||||
*self.sink_inputs.keys().nth(current_index).unwrap();
|
||||
|
||||
@@ -255,6 +252,7 @@ impl Mixer {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
None => (),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user