From 71f6e5731d9e7b0990f1a56aa03343466be6d193 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 3 Aug 2023 08:58:19 +0900 Subject: [PATCH] Fix potential null reference if no frames found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartłomiej Dach --- .../OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs index 66524f66ae..c1b1127542 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs @@ -211,7 +211,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate if (instance.Score == null) continue; - minFrameTimes.Add(instance.Score.Replay.Frames.Min(f => f.Time)); + minFrameTimes.Add(instance.Score.Replay.Frames.MinBy(f => f.Time)?.Time ?? 0); } // Remove any outliers (only need to worry about removing those lower than the mean since we will take a Min() after).