From f58c69e639b1bc5f72c4680f48d90cedb0d7a718 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Jul 2023 17:17:14 +0900 Subject: [PATCH] Fix potential startup crash due to early application of animations This was always haphazard code, but by luck it never triggered before drawable load until now. With the recently nullability changes, this would be triggered when `flash` is not yet constructed. Switching to `AddOnce` seems safer to avoid multiple applications, regardless. --- osu.Game.Tournament/Components/TournamentBeatmapPanel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 6933eafc29..49478a2174 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -136,11 +136,11 @@ private void matchChanged(ValueChangedEvent match) if (match.NewValue != null) match.NewValue.PicksBans.CollectionChanged += picksBansOnCollectionChanged; - updateState(); + Scheduler.AddOnce(updateState); } private void picksBansOnCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) - => updateState(); + => Scheduler.AddOnce(updateState); private BeatmapChoice? choice;