From d2abfe437020d96b88df85e06c866b23a342964e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 30 May 2025 19:54:49 +0200 Subject: [PATCH] SongSelectV2: Fix more crashes resulting from users deliberately trying to break things See https://github.com/ppy/osu/issues/33336#issuecomment-2922443444. Can't wait for even more human fuzzing to come later. --- osu.Game/Screens/SelectV2/SoloSongSelect.cs | 3 +++ osu.Game/Screens/SelectV2/SongSelect.cs | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/osu.Game/Screens/SelectV2/SoloSongSelect.cs b/osu.Game/Screens/SelectV2/SoloSongSelect.cs index a136e682c4..2c1eabc5fb 100644 --- a/osu.Game/Screens/SelectV2/SoloSongSelect.cs +++ b/osu.Game/Screens/SelectV2/SoloSongSelect.cs @@ -143,6 +143,9 @@ namespace osu.Game.Screens.SelectV2 private void edit(BeatmapInfo beatmap) { + if (!this.IsCurrentScreen()) + return; + FinaliseSelection(); // Forced refetch is important here to guarantee correct invalidation across all difficulties. diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index f4ba68cbd5..c753dd77cf 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -390,6 +390,9 @@ namespace osu.Game.Screens.SelectV2 private void selectBeatmap(BeatmapInfo beatmap) { + if (!this.IsCurrentScreen()) + return; + if (beatmap.BeatmapSet!.Protected) return; @@ -674,6 +677,9 @@ namespace osu.Game.Screens.SelectV2 /// public void SelectAndStart(BeatmapInfo beatmap) { + if (!this.IsCurrentScreen()) + return; + Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap); OnStart(); }