Skip to content

Commit

Permalink
Fix null handling when no items are populated but a selection is made
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Feb 2, 2025
1 parent 9c34819 commit 6a18d18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions osu.Game/Screens/SelectV2/BeatmapCarousel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ protected override bool HandleItemSelected(object? model)
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
{
Expand Down

0 comments on commit 6a18d18

Please # to comment.