mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 00:42:55 +08:00
Handle case in tests where current display becomes null
This commit is contained in:
parent
19816ae013
commit
b3527b92b6
@ -193,6 +193,12 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
|
||||
currentDisplay.BindValueChanged(display => Schedule(() =>
|
||||
{
|
||||
if (display.NewValue == null)
|
||||
{
|
||||
resolutions.Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
resolutions.ReplaceRange(1, resolutions.Count - 1, display.NewValue.DisplayModes
|
||||
.Where(m => m.Size.Width >= 800 && m.Size.Height >= 600)
|
||||
.OrderByDescending(m => Math.Max(m.Size.Height, m.Size.Width))
|
||||
|
Loading…
Reference in New Issue
Block a user