mirror of https://github.com/ppy/osu
Skip scores missing beatmaps during realm migration
This commit is contained in:
parent
96f86d035d
commit
942ea896f1
|
@ -374,12 +374,12 @@ private void migrateScores(OsuDbContext db)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue