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

fixes crash if all beatmaps of a set are hidden

This commit is contained in:
Aergwyn 2017-11-28 21:26:13 +01:00
parent 36d1b8a021
commit 6a4cc93360

View File

@ -45,7 +45,7 @@ namespace osu.Game.Screens.Select
Task.Run(() =>
{
newGroups = value.Select(createGroup).ToList();
newGroups = value.Select(createGroup).Where(g => g != null).ToList();
criteria.Filter(newGroups);
}).ContinueWith(t =>
{
@ -124,16 +124,24 @@ namespace osu.Game.Screens.Select
// todo: this method should be smarter as to not recreate panels that haven't changed, etc.
var group = groups.Find(b => b.BeatmapSet.ID == set.ID);
BeatmapGroup newGroup;
if (group == null)
return;
{
newGroup = createGroup(set);
int i = groups.IndexOf(group);
groups.RemoveAt(i);
if (newGroup != null)
groups.Add(newGroup);
}
else
{
int i = groups.IndexOf(group);
groups.RemoveAt(i);
var newGroup = createGroup(set);
newGroup = createGroup(set);
if (newGroup != null)
groups.Insert(i, newGroup);
if (newGroup != null)
groups.Insert(i, newGroup);
}
bool hadSelection = selectedGroup == group;