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

Fix null handling when no items are populated but a selection is made

This commit is contained in:
Dean Herbert 2025-02-02 13:28:31 +09:00
parent 9c34819ff4
commit 6a18d18feb
No known key found for this signature in database

View File

@ -124,9 +124,10 @@ namespace osu.Game.Screens.SelectV2
if (Criteria.SplitOutDifficulties)
{
// Find the containing group. There should never be too many groups so iterating is efficient enough.
GroupDefinition group = grouping.GroupItems.Single(kvp => kvp.Value.Any(i => ReferenceEquals(i.Model, beatmapInfo))).Key;
GroupDefinition? group = grouping.GroupItems.SingleOrDefault(kvp => kvp.Value.Any(i => ReferenceEquals(i.Model, beatmapInfo))).Key;
setVisibleGroup(group);
if (group != null)
setVisibleGroup(group);
}
else
{