mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix panic in case no default audio device found when audio off
This commit is contained in:
parent
dc2c3b0dd7
commit
c2b99f3a62
@ -116,13 +116,13 @@ fn main() {
|
||||
panic!("Failed to save settings: {:?}", err);
|
||||
}
|
||||
|
||||
let mut audio = if settings.audio.audio_on {
|
||||
let audio_device = match &settings.audio.audio_device {
|
||||
let audio_device = || match &settings.audio.audio_device {
|
||||
Some(d) => d.to_string(),
|
||||
None => audio::get_default_device(),
|
||||
};
|
||||
|
||||
AudioFrontend::new(audio_device, 16)
|
||||
let mut audio = if settings.audio.audio_on {
|
||||
AudioFrontend::new(audio_device(), 16)
|
||||
} else {
|
||||
AudioFrontend::no_audio()
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user