1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 18:12:55 +08:00

Avoid crashing when a system audio device provides a null name

This commit is contained in:
Dean Herbert 2022-11-21 14:51:41 +09:00
parent 4a79141824
commit 981264b011

View File

@ -59,7 +59,11 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
// the dropdown. BASS does not give us a simple mechanism to select
// specific audio devices in such a case anyways. Such
// functionality would require involved OS-specific code.
dropdown.Items = deviceItems.Distinct().ToList();
dropdown.Items = deviceItems
// Dropdown doesn't like null items. Somehow we are seeing some arrive here (see https://github.com/ppy/osu/issues/21271)
.Where(i => i != null)
.Distinct()
.ToList();
}
protected override void Dispose(bool isDisposing)