1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 11:53:21 +08:00

Fix potential null reference if no frames found

Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
This commit is contained in:
Dean Herbert 2023-08-03 08:58:19 +09:00 committed by GitHub
parent f38b21110f
commit 71f6e5731d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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).