1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 21:27:24 +08:00

Throw if a null BeatmapInfo arrives during score import process

This commit is contained in:
Dean Herbert 2023-07-05 16:07:12 +09:00
parent e2ddcb2349
commit 5947c2b298

View File

@ -98,10 +98,12 @@ namespace osu.Game.Scoring
/// <param name="score">The score to populate the statistics of.</param>
public void PopulateMaximumStatistics(ScoreInfo score)
{
Debug.Assert(score.BeatmapInfo != null);
if (score.MaximumStatistics.Select(kvp => kvp.Value).Sum() > 0)
return;
var beatmap = score.BeatmapInfo?.Detach();
var beatmap = score.BeatmapInfo!.Detach();
var ruleset = score.Ruleset.Detach();
var rulesetInstance = ruleset.CreateInstance();