Detach score during import tests to ensure original object doesn't get managed

This commit is contained in:
Dean Herbert 2022-01-10 13:38:23 +09:00
parent 463a185605
commit 33b5fa3473
1 changed files with 2 additions and 0 deletions

View File

@ -192,6 +192,8 @@ public static async Task<ScoreInfo> LoadScoreIntoOsu(OsuGameBase osu, ScoreInfo
{
var beatmapManager = osu.Dependencies.Get<BeatmapManager>();
// clone to avoid attaching the input score to realm.
score = score.DeepClone();
score.BeatmapInfo ??= beatmapManager.GetAllUsableBeatmapSets().First().Beatmaps.First();
score.Ruleset ??= new OsuRuleset().RulesetInfo;