From fbcb68466add1d727c6050cb143b3983193c79ee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 14 Jun 2023 17:50:46 +0900 Subject: [PATCH] Fix thing --- osu.Game/Database/RealmAccess.cs | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/osu.Game/Database/RealmAccess.cs b/osu.Game/Database/RealmAccess.cs index 68a46796560e..b2bbbf31555c 100644 --- a/osu.Game/Database/RealmAccess.cs +++ b/osu.Game/Database/RealmAccess.cs @@ -945,22 +945,26 @@ private void applyMigrationsForVersion(Migration migration, ulong targetVersion) foreach (var score in scores) { - // Recalculate the old-style standardised score to see if this was an old lazer score. - bool oldScoreMatchesExpectations = StandardisedScoreMigrationTools.GetOldStandardised(score) == score.TotalScore; - // Some older scores don't have correct statistics populated, so let's give them benefit of doubt. - bool scoreIsVeryOld = score.Date < new DateTime(2023, 1, 1, 0, 0, 0); - - if (oldScoreMatchesExpectations || scoreIsVeryOld) + try { - try - { - long calculatedNew = StandardisedScoreMigrationTools.GetNewStandardised(score); - score.TotalScore = calculatedNew; - } - catch + // Recalculate the old-style standardised score to see if this was an old lazer score. + bool oldScoreMatchesExpectations = StandardisedScoreMigrationTools.GetOldStandardised(score) == score.TotalScore; + // Some older scores don't have correct statistics populated, so let's give them benefit of doubt. + bool scoreIsVeryOld = score.Date < new DateTime(2023, 1, 1, 0, 0, 0); + + if (oldScoreMatchesExpectations || scoreIsVeryOld) { + try + { + long calculatedNew = StandardisedScoreMigrationTools.GetNewStandardised(score); + score.TotalScore = calculatedNew; + } + catch + { + } } } + catch { } } break;