From 33b5fa347375e3285e2b9752aeae685e9ee98a50 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 10 Jan 2022 13:38:23 +0900 Subject: [PATCH] Detach score during import tests to ensure original object doesn't get managed --- osu.Game.Tests/Scores/IO/ImportScoreTest.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Tests/Scores/IO/ImportScoreTest.cs b/osu.Game.Tests/Scores/IO/ImportScoreTest.cs index 1fa2a363b9..e14159da8e 100644 --- a/osu.Game.Tests/Scores/IO/ImportScoreTest.cs +++ b/osu.Game.Tests/Scores/IO/ImportScoreTest.cs @@ -192,6 +192,8 @@ public static async Task LoadScoreIntoOsu(OsuGameBase osu, ScoreInfo { var beatmapManager = osu.Dependencies.Get(); + // clone to avoid attaching the input score to realm. + score = score.DeepClone(); score.BeatmapInfo ??= beatmapManager.GetAllUsableBeatmapSets().First().Beatmaps.First(); score.Ruleset ??= new OsuRuleset().RulesetInfo;