From 55ed823c882a38f21b14ca5644a2ef4f3efd35ed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 19 Jan 2020 22:26:15 +0900 Subject: [PATCH 1/3] Fix hard crashes on tournament client if a round contains an empty beatmap --- osu.Game.Tournament/TournamentGameBase.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index bd91ad9704..8f9acfd5be 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -223,15 +223,22 @@ namespace osu.Game.Tournament foreach (var r in ladder.Rounds) { - foreach (var b in r.Beatmaps) + foreach (var b in r.Beatmaps.ToList()) { - if (b.BeatmapInfo == null && b.ID > 0) + if (b.BeatmapInfo == null) { - var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); - API.Perform(req); - b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore); + if (b.ID > 0) + { + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); + API.Perform(req); + b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore); - addedInfo = true; + addedInfo = true; + } + + if (b.BeatmapInfo == null) + // if online population couldn't be performed, ensure we don't leave a null value behind + r.Beatmaps.Remove(b); } } } From 5a2ed5391d758674b63ed689b514240305add30e Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sun, 19 Jan 2020 23:51:10 +0300 Subject: [PATCH 2/3] Update license year --- Directory.Build.props | 2 +- LICENCE | 2 +- osu.Desktop/osu.nuspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 27a0bd0d48..21b8b402e0 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -40,7 +40,7 @@ https://github.com/ppy/osu Automated release. ppy Pty Ltd - Copyright (c) 2019 ppy Pty Ltd + Copyright (c) 2020 ppy Pty Ltd osu game \ No newline at end of file diff --git a/LICENCE b/LICENCE index 21c6a7090f..2435c23545 100644 --- a/LICENCE +++ b/LICENCE @@ -1,4 +1,4 @@ -Copyright (c) 2019 ppy Pty Ltd . +Copyright (c) 2020 ppy Pty Ltd . Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/osu.Desktop/osu.nuspec b/osu.Desktop/osu.nuspec index a26b35fcd5..a919d54f38 100644 --- a/osu.Desktop/osu.nuspec +++ b/osu.Desktop/osu.nuspec @@ -12,7 +12,7 @@ click the circles. to the beat. click the circles. testing - Copyright (c) 2019 ppy Pty Ltd + Copyright (c) 2020 ppy Pty Ltd en-AU From 43f144cd6a683abc85a6e51d47fc0f7471c8bd2b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 20 Jan 2020 11:48:56 +0900 Subject: [PATCH 3/3] Invert condition --- osu.Game.Tournament/TournamentGameBase.cs | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs index 8f9acfd5be..17d7dc0245 100644 --- a/osu.Game.Tournament/TournamentGameBase.cs +++ b/osu.Game.Tournament/TournamentGameBase.cs @@ -225,21 +225,21 @@ namespace osu.Game.Tournament { foreach (var b in r.Beatmaps.ToList()) { - if (b.BeatmapInfo == null) + if (b.BeatmapInfo != null) + continue; + + if (b.ID > 0) { - if (b.ID > 0) - { - var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); - API.Perform(req); - b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore); + var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID }); + API.Perform(req); + b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore); - addedInfo = true; - } - - if (b.BeatmapInfo == null) - // if online population couldn't be performed, ensure we don't leave a null value behind - r.Beatmaps.Remove(b); + addedInfo = true; } + + if (b.BeatmapInfo == null) + // if online population couldn't be performed, ensure we don't leave a null value behind + r.Beatmaps.Remove(b); } }