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
1 changed files with 1 additions and 1 deletions

View File

@ -511,7 +511,7 @@ void performMove(float y, float? startY = null)
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);