1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Merge pull request #16657 from peppy/skip-scores-missing-beatmap

Skip scores missing beatmaps during realm migration
This commit is contained in:
Dean Herbert 2022-01-28 01:33:12 +09:00 committed by GitHub
commit 6beb0ff2a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -374,12 +374,12 @@ namespace osu.Game.Database
log($"Migrated {written}/{count} scores...");
}
var beatmap = r.All<BeatmapInfo>().First(b => b.Hash == score.BeatmapInfo.Hash);
var beatmap = r.All<BeatmapInfo>().FirstOrDefault(b => b.Hash == score.BeatmapInfo.Hash);
var ruleset = r.Find<RulesetInfo>(score.Ruleset.ShortName);
if (ruleset == null)
if (beatmap == null || ruleset == null)
{
log($"Skipping {++missing} scores with missing ruleset");
log($"Skipping {++missing} scores with missing ruleset or beatmap");
continue;
}