1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:43:01 +08:00

Merge pull request #3104 from peppy/fix-invalid-operation

Fix a potential InvalidOperationException when entering song select
This commit is contained in:
Dan Balasescu 2018-07-25 14:49:26 +09:00 committed by GitHub
commit dcf70bbd54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,8 +79,13 @@ namespace osu.Game.Screens.Select.Carousel
public override void Filter(FilterCriteria criteria) public override void Filter(FilterCriteria criteria)
{ {
base.Filter(criteria); base.Filter(criteria);
InternalChildren.Sort((x, y) => x.CompareTo(criteria, y));
InternalChildren.ForEach(c => c.Filter(criteria)); var children = new List<CarouselItem>(InternalChildren);
children.Sort((x, y) => x.CompareTo(criteria, y));
children.ForEach(c => c.Filter(criteria));
InternalChildren = children;
} }
protected virtual void ChildItemStateChanged(CarouselItem item, CarouselItemState value) protected virtual void ChildItemStateChanged(CarouselItem item, CarouselItemState value)