From 657bc31539cc459e293808fcb7c0eb7504e4b355 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 29 Oct 2025 22:58:56 +0900 Subject: [PATCH] Fix potential sources of empty sequence errors --- .../OnlinePlay/Matchmaking/Match/Results/SubScreenResults.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/Results/SubScreenResults.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/Results/SubScreenResults.cs index 6ba6b3f4b0..2f3fb2debb 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/Results/SubScreenResults.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/Results/SubScreenResults.cs @@ -221,7 +221,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.Results int accuracyPlacement = accuracyOrderedUsers.index + 1; addStatistic(accuracyPlacement, $"Overall accuracy ({accuracyOrderedUsers.info.avgAcc.FormatAccuracy()})"); - var maxComboOrderedUsers = state.Users.Select(u => (user: u, maxCombo: u.Rounds.Max(r => r.MaxCombo))) + var maxComboOrderedUsers = state.Users.Select(u => (user: u, maxCombo: u.Rounds.Select(r => r.MaxCombo).DefaultIfEmpty(0).Max())) .OrderByDescending(t => t.maxCombo) .Select((t, i) => (info: t, index: i)) .Single(t => t.info.user.UserId == client.LocalUser!.UserID); @@ -229,7 +229,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.Results addStatistic(maxComboPlacement, $"Best max combo ({maxComboOrderedUsers.info.maxCombo}x)"); var bestPlacement = localUserState.Rounds.MinBy(r => r.Placement); - addStatistic(bestPlacement!.Placement, $"Best round placement (round {bestPlacement.Round})"); + if (bestPlacement != null) + addStatistic(bestPlacement.Placement, $"Best round placement (round {bestPlacement.Round})"); void addStatistic(int position, string text) => userStatistics.Add(new PanelUserStatistic(position, text)); }