mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 16:02:55 +08:00
Fix delete local scores crashing the game
This commit is contained in:
parent
2453bf5ed0
commit
0d3ac4fd9c
@ -266,6 +266,15 @@ namespace osu.Game.Scoring
|
||||
});
|
||||
}
|
||||
|
||||
public void Delete(BeatmapInfo beatmap, bool silent = false)
|
||||
{
|
||||
realm.Run(r =>
|
||||
{
|
||||
var beatmapScores = r.Find<BeatmapInfo>(beatmap.ID).Scores.ToList();
|
||||
scoreModelManager.Delete(beatmapScores, silent);
|
||||
});
|
||||
}
|
||||
|
||||
public void Delete(List<ScoreInfo> items, bool silent = false)
|
||||
{
|
||||
scoreModelManager.Delete(items, silent);
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Screens.Select
|
||||
Text = @"Yes. Please.",
|
||||
Action = () =>
|
||||
{
|
||||
Task.Run(() => scoreManager.Delete(s => !s.DeletePending && s.BeatmapInfo.ID == beatmapInfo.ID))
|
||||
Task.Run(() => scoreManager.Delete(beatmapInfo))
|
||||
.ContinueWith(_ => onCompletion);
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user