1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:13:22 +08:00

Merge pull request #1630 from Aergwyn/fix-set-hidden-crash

Fix crash when all beatmaps in a set are hidden
This commit is contained in:
Dean Herbert 2017-12-01 23:48:30 +09:00 committed by GitHub
commit f547b3bde5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

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,19 @@ 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);
if (group == null)
return;
int i = groups.IndexOf(group);
groups.RemoveAt(i);
if (i >= 0)
groups.RemoveAt(i);
var newGroup = createGroup(set);
if (newGroup != null)
groups.Insert(i, newGroup);
{
if (i >= 0)
groups.Insert(i, newGroup);
else
groups.Add(newGroup);
}
bool hadSelection = selectedGroup == group;

View File

@ -263,10 +263,7 @@ namespace osu.Game.Screens.Select
beatmapNoDebounce = beatmap;
if (beatmap == null)
{
if (!Beatmap.IsDefault)
performLoad();
}
performLoad();
else
{
if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID)