From ee6263f3956ab5b96c48b0801d32911502338fc2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Nov 2018 20:14:50 +0900 Subject: [PATCH] Fix old maps not getting cleared when switching matches --- .../Screens/MapPool/MapPoolScreen.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index c7bdf8feee..e8d6f18fd7 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -180,12 +180,17 @@ private void addForBeatmap(int beatmapId) private void matchChanged(MatchPairing match) { - foreach (var b in match.Grouping.Value.Beatmaps) - maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo) - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - }); + maps.Clear(); + + if (match.Grouping.Value != null) + { + foreach (var b in match.Grouping.Value.Beatmaps) + maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }); + } } } }