Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tournament population failure when beatmap is not found on server #20073

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions osu.Game.Tournament/Models/TournamentBeatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Game.Beatmaps;
using osu.Game.Extensions;
using osu.Game.Online.API.Requests.Responses;
Expand Down Expand Up @@ -41,7 +40,7 @@ public TournamentBeatmap(APIBeatmap beatmap)
StarRating = beatmap.StarRating;
Metadata = beatmap.Metadata;
Difficulty = beatmap.Difficulty;
Covers = beatmap.BeatmapSet.AsNonNull().Covers;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AsNonNull usage here was incorrect (fetch logic falls back to new APIBeatmap() which doesn't have a BeatmapSet).

Covers = beatmap.BeatmapSet?.Covers ?? new BeatmapSetOnlineCovers();
}

public bool Equals(IBeatmapInfo? other) => other is TournamentBeatmap b && this.MatchesOnlineID(b);
Expand Down
2 changes: 0 additions & 2 deletions osu.Game/Beatmaps/BeatmapSetOnlineCovers.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable

using Newtonsoft.Json;

namespace osu.Game.Beatmaps
Expand Down