Skip to content

Commit

Permalink
Merge pull request #28213 from bdach/fix-realm-migration-fail
Browse files Browse the repository at this point in the history
Fix total score without mods migration failing on custom ruleset scores when custom ruleset cannot be loaded
  • Loading branch information
peppy authored May 19, 2024
2 parents 9fcd3b5 + be642c8 commit 5e1f696
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion osu.Game/Database/RealmAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,17 @@ void convertOnlineIDs<T>() where T : RealmObject

case 41:
foreach (var score in migration.NewRealm.All<ScoreInfo>())
LegacyScoreDecoder.PopulateTotalScoreWithoutMods(score);
{
try
{
// this can fail e.g. if a user has a score set on a ruleset that can no longer be loaded.
LegacyScoreDecoder.PopulateTotalScoreWithoutMods(score);
}
catch (Exception ex)
{
Logger.Log($@"Failed to populate total score without mods for score {score.ID}: {ex}", LoggingTarget.Database);
}
}

break;
}
Expand Down

0 comments on commit 5e1f696

Please sign in to comment.