From dc576c19b47fa64e74bfb9fd440dfccf345bd195 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 May 2021 15:10:02 +0900 Subject: [PATCH 1/2] Fix a potential nullref when starting `Player` with autoplay enabled and beatmap fails to load --- osu.Game/Screens/Play/Player.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index ac0c921ccf..15983d1d62 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -154,6 +154,10 @@ namespace osu.Game.Screens.Play { base.LoadComplete(); + // BDL load may have aborted early. + if (DrawableRuleset == null) + return; + // replays should never be recorded or played back when autoplay is enabled if (!Mods.Value.Any(m => m is ModAutoplay)) PrepareReplay(); From f5dd18f266a11ecc941b2ebd65c6ea40adb70cab Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 May 2021 16:53:51 +0900 Subject: [PATCH 2/2] Use existing `LoadedBeatmapSuccessfully` bool instead Co-authored-by: Salman Ahmed --- osu.Game/Screens/Play/Player.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 15983d1d62..06dfd2fdb7 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -154,8 +154,7 @@ namespace osu.Game.Screens.Play { base.LoadComplete(); - // BDL load may have aborted early. - if (DrawableRuleset == null) + if (!LoadedBeatmapSuccessfully) return; // replays should never be recorded or played back when autoplay is enabled