From f282152f996b3e15dffa9ae7564c1e09788430dd Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sun, 14 Apr 2024 15:53:29 -0700 Subject: [PATCH 1/9] Enable NRT to `ScoreManager` --- .../Database/BackgroundDataStoreProcessor.cs | 17 ++++++++++------- osu.Game/Scoring/ScoreManager.cs | 18 ++++++++---------- osu.Game/Screens/Play/SaveFailedScoreButton.cs | 2 +- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/osu.Game/Database/BackgroundDataStoreProcessor.cs b/osu.Game/Database/BackgroundDataStoreProcessor.cs index 872194aa1d..52336c0242 100644 --- a/osu.Game/Database/BackgroundDataStoreProcessor.cs +++ b/osu.Game/Database/BackgroundDataStoreProcessor.cs @@ -287,14 +287,17 @@ namespace osu.Game.Database { var score = scoreManager.Query(s => s.ID == id); - scoreManager.PopulateMaximumStatistics(score); - - // Can't use async overload because we're not on the update thread. - // ReSharper disable once MethodHasAsyncOverload - realmAccess.Write(r => + if (score != null) { - r.Find(id)!.MaximumStatisticsJson = JsonConvert.SerializeObject(score.MaximumStatistics); - }); + scoreManager.PopulateMaximumStatistics(score); + + // Can't use async overload because we're not on the update thread. + // ReSharper disable once MethodHasAsyncOverload + realmAccess.Write(r => + { + r.Find(id)!.MaximumStatisticsJson = JsonConvert.SerializeObject(score.MaximumStatistics); + }); + } ++processedCount; } diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index 1ee99e9e93..1cdf4b0c13 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using System.Collections.Generic; using System.Diagnostics; @@ -28,7 +26,7 @@ namespace osu.Game.Scoring public class ScoreManager : ModelManager, IModelImporter { private readonly Func beatmaps; - private readonly OsuConfigManager configManager; + private readonly OsuConfigManager? configManager; private readonly ScoreImporter scoreImporter; private readonly LegacyScoreExporter scoreExporter; @@ -43,7 +41,7 @@ namespace osu.Game.Scoring } public ScoreManager(RulesetStore rulesets, Func beatmaps, Storage storage, RealmAccess realm, IAPIProvider api, - OsuConfigManager configManager = null) + OsuConfigManager? configManager = null) : base(storage, realm) { this.beatmaps = beatmaps; @@ -67,7 +65,7 @@ namespace osu.Game.Scoring /// /// The query. /// The first result for the provided query, or null if no results were found. - public ScoreInfo Query(Expression> query) + public ScoreInfo? Query(Expression> query) { return Realm.Run(r => r.All().FirstOrDefault(query)?.Detach()); } @@ -104,7 +102,7 @@ namespace osu.Game.Scoring /// /// The to provide the total score of. /// The config. - public TotalScoreBindable(ScoreInfo score, OsuConfigManager configManager) + public TotalScoreBindable(ScoreInfo score, OsuConfigManager? configManager) { configManager?.BindWith(OsuSetting.ScoreDisplayMode, scoringMode); scoringMode.BindValueChanged(mode => Value = score.GetDisplayScore(mode.NewValue), true); @@ -126,7 +124,7 @@ namespace osu.Game.Scoring } } - public void Delete([CanBeNull] Expression> filter = null, bool silent = false) + public void Delete(Expression>? filter = null, bool silent = false) { Realm.Run(r => { @@ -165,9 +163,9 @@ namespace osu.Game.Scoring public Task Export(ScoreInfo score) => scoreExporter.ExportAsync(score.ToLive(Realm)); - public Task> ImportAsUpdate(ProgressNotification notification, ImportTask task, ScoreInfo original) => scoreImporter.ImportAsUpdate(notification, task, original); + public Task?> ImportAsUpdate(ProgressNotification notification, ImportTask task, ScoreInfo original) => scoreImporter.ImportAsUpdate(notification, task, original); - public Live Import(ScoreInfo item, ArchiveReader archive = null, ImportParameters parameters = default, CancellationToken cancellationToken = default) => + public Live? Import(ScoreInfo item, ArchiveReader? archive = null, ImportParameters parameters = default, CancellationToken cancellationToken = default) => scoreImporter.ImportModel(item, archive, parameters, cancellationToken); /// @@ -182,7 +180,7 @@ namespace osu.Game.Scoring #region Implementation of IPresentImports - public Action>> PresentImport + public Action>>? PresentImport { set => scoreImporter.PresentImport = value; } diff --git a/osu.Game/Screens/Play/SaveFailedScoreButton.cs b/osu.Game/Screens/Play/SaveFailedScoreButton.cs index ef27aac1b9..4f665b87e8 100644 --- a/osu.Game/Screens/Play/SaveFailedScoreButton.cs +++ b/osu.Game/Screens/Play/SaveFailedScoreButton.cs @@ -137,7 +137,7 @@ namespace osu.Game.Screens.Play { if (state.NewValue != DownloadState.LocallyAvailable) return; - scoreManager.Export(importedScore); + if (importedScore != null) scoreManager.Export(importedScore); this.state.ValueChanged -= exportWhenReady; } From ed8b59632561cfbbfa7e949daa4709660cc3356d Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sun, 14 Apr 2024 16:22:58 -0700 Subject: [PATCH 2/9] Fix replay export not working correctly from online leaderboards --- osu.Game/OsuGame.cs | 19 ++--------- osu.Game/Scoring/ScoreManager.cs | 34 +++++++++++++++++-- .../Screens/Ranking/ReplayDownloadButton.cs | 4 ++- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 732d5f867c..bcf12b308d 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -706,24 +706,9 @@ namespace osu.Game { Logger.Log($"Beginning {nameof(PresentScore)} with score {score}"); - // The given ScoreInfo may have missing properties if it was retrieved from online data. Re-retrieve it from the database - // to ensure all the required data for presenting a replay are present. - ScoreInfo databasedScoreInfo = null; + ScoreInfo databasedScoreInfo = ScoreManager.GetDatabasedScoreInfo(score); - if (score.OnlineID > 0) - databasedScoreInfo = ScoreManager.Query(s => s.OnlineID == score.OnlineID); - - if (score.LegacyOnlineID > 0) - databasedScoreInfo ??= ScoreManager.Query(s => s.LegacyOnlineID == score.LegacyOnlineID); - - if (score is ScoreInfo scoreInfo) - databasedScoreInfo ??= ScoreManager.Query(s => s.Hash == scoreInfo.Hash); - - if (databasedScoreInfo == null) - { - Logger.Log("The requested score could not be found locally.", LoggingTarget.Information); - return; - } + if (databasedScoreInfo == null) return; var databasedScore = ScoreManager.GetScore(databasedScoreInfo); diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index 1cdf4b0c13..f699e32ac7 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -8,8 +8,8 @@ using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; -using JetBrains.Annotations; using osu.Framework.Bindables; +using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Configuration; @@ -70,6 +70,34 @@ namespace osu.Game.Scoring return Realm.Run(r => r.All().FirstOrDefault(query)?.Detach()); } + /// + /// Re-retrieve a given from the database to ensure all the required data for presenting / exporting a replay are present. + /// + /// The to attempt querying on. + /// The databased score info. Null if the score on the database cannot be found. + /// Can be used when the was retrieved from online data, as it may have missing properties. + public ScoreInfo? GetDatabasedScoreInfo(IScoreInfo originalScoreInfo) + { + ScoreInfo? databasedScoreInfo = null; + + if (originalScoreInfo.OnlineID > 0) + databasedScoreInfo = Query(s => s.OnlineID == originalScoreInfo.OnlineID); + + if (originalScoreInfo.LegacyOnlineID > 0) + databasedScoreInfo ??= Query(s => s.LegacyOnlineID == originalScoreInfo.LegacyOnlineID); + + if (originalScoreInfo is ScoreInfo scoreInfo) + databasedScoreInfo ??= Query(s => s.Hash == scoreInfo.Hash); + + if (databasedScoreInfo == null) + { + Logger.Log("The requested score could not be found locally.", LoggingTarget.Information); + return null; + } + + return databasedScoreInfo; + } + /// /// Retrieves a bindable that represents the total score of a . /// @@ -78,7 +106,7 @@ namespace osu.Game.Scoring /// /// The to retrieve the bindable for. /// The bindable containing the total score. - public Bindable GetBindableTotalScore([NotNull] ScoreInfo score) => new TotalScoreBindable(score, configManager); + public Bindable GetBindableTotalScore(ScoreInfo score) => new TotalScoreBindable(score, configManager); /// /// Retrieves a bindable that represents the formatted total score string of a . @@ -88,7 +116,7 @@ namespace osu.Game.Scoring /// /// The to retrieve the bindable for. /// The bindable containing the formatted total score string. - public Bindable GetBindableTotalScoreString([NotNull] ScoreInfo score) => new TotalScoreStringBindable(GetBindableTotalScore(score)); + public Bindable GetBindableTotalScoreString(ScoreInfo score) => new TotalScoreStringBindable(GetBindableTotalScore(score)); /// /// Provides the total score of a . Responds to changes in the currently-selected . diff --git a/osu.Game/Screens/Ranking/ReplayDownloadButton.cs b/osu.Game/Screens/Ranking/ReplayDownloadButton.cs index df5f9c7a8a..9bacfc5ed3 100644 --- a/osu.Game/Screens/Ranking/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Ranking/ReplayDownloadButton.cs @@ -147,7 +147,9 @@ namespace osu.Game.Screens.Ranking { if (state.NewValue != DownloadState.LocallyAvailable) return; - scoreManager.Export(Score.Value); + ScoreInfo? databasedScoreInfo = scoreManager.GetDatabasedScoreInfo(Score.Value); + + if (databasedScoreInfo != null) scoreManager.Export(databasedScoreInfo); State.ValueChanged -= exportWhenReady; } From 67cfcddc7727fb5a735cff9ce3dab8d0bae0e004 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Mon, 15 Apr 2024 20:18:24 -0700 Subject: [PATCH 3/9] Use another beatmap query to not depend on databased score info --- osu.Game/OsuGame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index bcf12b308d..6a29767a8e 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -718,7 +718,7 @@ namespace osu.Game return; } - var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.ID == databasedScoreInfo.BeatmapInfo.ID); + var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.OnlineID == score.Beatmap.OnlineID); if (databasedBeatmap == null) { From 514e316b49ad9721e0e7997d02fc14dae3c86504 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Mon, 15 Apr 2024 20:48:51 -0700 Subject: [PATCH 4/9] Make `getDatabasedScoreInfo()` private and move to `GetScore()` and `Export()` --- osu.Game/OsuGame.cs | 6 ++---- osu.Game/Scoring/ScoreManager.cs | 16 +++++++++++++--- osu.Game/Screens/Ranking/ReplayDownloadButton.cs | 4 +--- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 6a29767a8e..ccdf9d151f 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -706,11 +706,9 @@ namespace osu.Game { Logger.Log($"Beginning {nameof(PresentScore)} with score {score}"); - ScoreInfo databasedScoreInfo = ScoreManager.GetDatabasedScoreInfo(score); + var databasedScore = ScoreManager.GetScore(score); - if (databasedScoreInfo == null) return; - - var databasedScore = ScoreManager.GetScore(databasedScoreInfo); + if (databasedScore == null) return; if (databasedScore.Replay == null) { diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index f699e32ac7..3f6c6ee49d 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -58,7 +58,12 @@ namespace osu.Game.Scoring }; } - public Score GetScore(ScoreInfo score) => scoreImporter.GetScore(score); + public Score? GetScore(IScoreInfo scoreInfo) + { + ScoreInfo? databasedScoreInfo = getDatabasedScoreInfo(scoreInfo); + + return databasedScoreInfo == null ? null : scoreImporter.GetScore(databasedScoreInfo); + } /// /// Perform a lookup query on available s. @@ -76,7 +81,7 @@ namespace osu.Game.Scoring /// The to attempt querying on. /// The databased score info. Null if the score on the database cannot be found. /// Can be used when the was retrieved from online data, as it may have missing properties. - public ScoreInfo? GetDatabasedScoreInfo(IScoreInfo originalScoreInfo) + private ScoreInfo? getDatabasedScoreInfo(IScoreInfo originalScoreInfo) { ScoreInfo? databasedScoreInfo = null; @@ -189,7 +194,12 @@ namespace osu.Game.Scoring public Task>> Import(ProgressNotification notification, ImportTask[] tasks, ImportParameters parameters = default) => scoreImporter.Import(notification, tasks); - public Task Export(ScoreInfo score) => scoreExporter.ExportAsync(score.ToLive(Realm)); + public Task? Export(ScoreInfo scoreInfo) + { + ScoreInfo? databasedScoreInfo = getDatabasedScoreInfo(scoreInfo); + + return databasedScoreInfo == null ? null : scoreExporter.ExportAsync(databasedScoreInfo.ToLive(Realm)); + } public Task?> ImportAsUpdate(ProgressNotification notification, ImportTask task, ScoreInfo original) => scoreImporter.ImportAsUpdate(notification, task, original); diff --git a/osu.Game/Screens/Ranking/ReplayDownloadButton.cs b/osu.Game/Screens/Ranking/ReplayDownloadButton.cs index 9bacfc5ed3..df5f9c7a8a 100644 --- a/osu.Game/Screens/Ranking/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Ranking/ReplayDownloadButton.cs @@ -147,9 +147,7 @@ namespace osu.Game.Screens.Ranking { if (state.NewValue != DownloadState.LocallyAvailable) return; - ScoreInfo? databasedScoreInfo = scoreManager.GetDatabasedScoreInfo(Score.Value); - - if (databasedScoreInfo != null) scoreManager.Export(databasedScoreInfo); + scoreManager.Export(Score.Value); State.ValueChanged -= exportWhenReady; } From d08b1e5ae7a413c3ec6a958b1bc592e20baf6c8e Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Wed, 17 Apr 2024 21:18:54 -0700 Subject: [PATCH 5/9] Add xmldoc to `GetScore()` and `Export()` and remove xmldoc from private `getDatabasedScoreInfo()` --- osu.Game/Scoring/ScoreManager.cs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index 3f6c6ee49d..b6bb637537 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -58,6 +58,15 @@ namespace osu.Game.Scoring }; } + /// + /// Retrieve a from a given . + /// + /// The to convert. + /// The . Null if the score on the database cannot be found. + /// + /// The is re-retrieved from the database to ensure all the required data + /// for retrieving a replay are present (may have missing properties if it was retrieved from online data). + /// public Score? GetScore(IScoreInfo scoreInfo) { ScoreInfo? databasedScoreInfo = getDatabasedScoreInfo(scoreInfo); @@ -75,12 +84,6 @@ namespace osu.Game.Scoring return Realm.Run(r => r.All().FirstOrDefault(query)?.Detach()); } - /// - /// Re-retrieve a given from the database to ensure all the required data for presenting / exporting a replay are present. - /// - /// The to attempt querying on. - /// The databased score info. Null if the score on the database cannot be found. - /// Can be used when the was retrieved from online data, as it may have missing properties. private ScoreInfo? getDatabasedScoreInfo(IScoreInfo originalScoreInfo) { ScoreInfo? databasedScoreInfo = null; @@ -194,6 +197,15 @@ namespace osu.Game.Scoring public Task>> Import(ProgressNotification notification, ImportTask[] tasks, ImportParameters parameters = default) => scoreImporter.Import(notification, tasks); + /// + /// Export a replay from a given . + /// + /// The to export. + /// The . Null if the score on the database cannot be found. + /// + /// The is re-retrieved from the database to ensure all the required data + /// for exporting a replay are present (may have missing properties if it was retrieved from online data). + /// public Task? Export(ScoreInfo scoreInfo) { ScoreInfo? databasedScoreInfo = getDatabasedScoreInfo(scoreInfo); From 2eda56ff0859a0e0fe44e59d2b7f936139dcc94b Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Mon, 22 Apr 2024 11:15:50 -0700 Subject: [PATCH 6/9] Revert beatmap query change --- osu.Game/OsuGame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index ccdf9d151f..98533a5c82 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -716,7 +716,7 @@ namespace osu.Game return; } - var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.OnlineID == score.Beatmap.OnlineID); + var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.ID == databasedScore.ScoreInfo.BeatmapInfo.ID); if (databasedBeatmap == null) { From a59bf6d373cfdc234261fc1ce2d489803bd35f14 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Mon, 22 Apr 2024 11:17:27 -0700 Subject: [PATCH 7/9] Improve xmldoc wording --- osu.Game/Scoring/ScoreManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index b6bb637537..f37ee2b101 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -62,7 +62,7 @@ namespace osu.Game.Scoring /// Retrieve a from a given . /// /// The to convert. - /// The . Null if the score on the database cannot be found. + /// The . Null if the score cannot be found in the database. /// /// The is re-retrieved from the database to ensure all the required data /// for retrieving a replay are present (may have missing properties if it was retrieved from online data). @@ -201,7 +201,7 @@ namespace osu.Game.Scoring /// Export a replay from a given . /// /// The to export. - /// The . Null if the score on the database cannot be found. + /// The . Null if the score cannot be found in the database. /// /// The is re-retrieved from the database to ensure all the required data /// for exporting a replay are present (may have missing properties if it was retrieved from online data). From 35eddf35c5651b883a65e955a750ddd2c05b47be Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Mon, 22 Apr 2024 11:22:39 -0700 Subject: [PATCH 8/9] Return `Task.CompletedTask` instead of `null` --- osu.Game/Scoring/ScoreManager.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index f37ee2b101..1ba5c7d4cf 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -201,16 +201,16 @@ namespace osu.Game.Scoring /// Export a replay from a given . /// /// The to export. - /// The . Null if the score cannot be found in the database. + /// The . Return if the score cannot be found in the database. /// /// The is re-retrieved from the database to ensure all the required data /// for exporting a replay are present (may have missing properties if it was retrieved from online data). /// - public Task? Export(ScoreInfo scoreInfo) + public Task Export(ScoreInfo scoreInfo) { ScoreInfo? databasedScoreInfo = getDatabasedScoreInfo(scoreInfo); - return databasedScoreInfo == null ? null : scoreExporter.ExportAsync(databasedScoreInfo.ToLive(Realm)); + return databasedScoreInfo == null ? Task.CompletedTask : scoreExporter.ExportAsync(databasedScoreInfo.ToLive(Realm)); } public Task?> ImportAsUpdate(ProgressNotification notification, ImportTask task, ScoreInfo original) => scoreImporter.ImportAsUpdate(notification, task, original); From 49154c0e231c25f78c849ecf7180b4240b9e0145 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Mon, 22 Apr 2024 11:23:38 -0700 Subject: [PATCH 9/9] Fix code quality --- osu.Game.Tests/Visual/Navigation/TestScenePresentScore.cs | 2 +- .../Visual/UserInterface/TestSceneDeleteLocalScore.cs | 2 +- osu.Game/Screens/Play/Player.cs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/Navigation/TestScenePresentScore.cs b/osu.Game.Tests/Visual/Navigation/TestScenePresentScore.cs index 6590339311..004d1de116 100644 --- a/osu.Game.Tests/Visual/Navigation/TestScenePresentScore.cs +++ b/osu.Game.Tests/Visual/Navigation/TestScenePresentScore.cs @@ -170,7 +170,7 @@ namespace osu.Game.Tests.Visual.Navigation BeatmapInfo = beatmap.Beatmaps.First(), Ruleset = ruleset ?? new OsuRuleset().RulesetInfo, User = new GuestUser(), - }).Value; + })!.Value; }); AddAssert($"import {i} succeeded", () => imported != null); diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneDeleteLocalScore.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneDeleteLocalScore.cs index 529874b71e..e2fe10fa74 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneDeleteLocalScore.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneDeleteLocalScore.cs @@ -104,7 +104,7 @@ namespace osu.Game.Tests.Visual.UserInterface Files = { new RealmNamedFileUsage(new RealmFile { Hash = $"{i}" }, string.Empty) } }; - importedScores.Add(scoreManager.Import(score).Value); + importedScores.Add(scoreManager.Import(score)!.Value); } }); }); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 4fcc52bc5d..3a80caf259 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -1200,6 +1200,7 @@ namespace osu.Game.Screens.Play var importableScore = score.ScoreInfo.DeepClone(); var imported = scoreManager.Import(importableScore, replayReader); + Debug.Assert(imported != null); imported.PerformRead(s => {