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
1 changed files with 3 additions and 1 deletions

View File

@ -98,10 +98,12 @@ protected override void Populate(ScoreInfo model, ArchiveReader? archive, Realm
/// <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();