1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 00:02:54 +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,8 +124,9 @@ namespace osu.Game.Screens.SelectV2
if (Criteria.SplitOutDifficulties) if (Criteria.SplitOutDifficulties)
{ {
// Find the containing group. There should never be too many groups so iterating is efficient enough. // 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;
if (group != null)
setVisibleGroup(group); setVisibleGroup(group);
} }
else else