mirror of https://github.com/ppy/osu
Fix weird edge case of nullability in `CarouselRoot`
A bit unfortunately, but it's what we get for having ctor level bindings..
This commit is contained in:
parent
e18b524f8e
commit
f3bda4e040
|
@ -1005,7 +1005,8 @@ private class CarouselBoundsItem : CarouselItem
|
|||
|
||||
private class CarouselRoot : CarouselGroupEagerSelect
|
||||
{
|
||||
private readonly BeatmapCarousel carousel;
|
||||
// May only be null during construction (State.Value set causes PerformSelection to be triggered).
|
||||
private readonly BeatmapCarousel? carousel;
|
||||
|
||||
public readonly Dictionary<Guid, CarouselBeatmapSet> BeatmapSetsByID = new Dictionary<Guid, CarouselBeatmapSet>();
|
||||
|
||||
|
@ -1048,7 +1049,7 @@ public override void RemoveItem(CarouselItem i)
|
|||
protected override void PerformSelection()
|
||||
{
|
||||
if (LastSelected == null || LastSelected.Filtered.Value)
|
||||
carousel.SelectNextRandom();
|
||||
carousel?.SelectNextRandom();
|
||||
else
|
||||
base.PerformSelection();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue