1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 10:22:56 +08:00

Switch to a better way of deciding on null selection

This avoids `SelectionChanged` potentially being invoked multiple times after `selectedBeatmapSet` is already `null`.
This commit is contained in:
Dean Herbert 2017-12-26 13:41:02 +09:00
parent 2473f6de46
commit 09ce24a7db

View File

@ -511,7 +511,7 @@ namespace osu.Game.Screens.Select
currentY += DrawHeight / 2;
scrollableContent.Height = currentY;
if (!Items.Any() || selectedBeatmapSet != null && selectedBeatmapSet.State.Value != CarouselItemState.Selected)
if (selectedBeatmapSet != null && (selectedBeatmap == null || selectedBeatmapSet.State.Value != CarouselItemState.Selected))
{
selectedBeatmapSet = null;
SelectionChanged?.Invoke(null);