1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:03:22 +08:00

Merge pull request #22192 from stanriders/fix-group-badges

Fix `GroupBadge` crashing on `null` group colour
This commit is contained in:
Bartłomiej Dach 2023-01-14 01:17:58 +01:00 committed by GitHub
commit b37c3203e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ namespace osu.Game.Online.API.Requests.Responses
public class APIUserGroup
{
[JsonProperty(@"colour")]
public string Colour { get; set; } = null!;
public string? Colour { get; set; }
[JsonProperty(@"has_listing")]
public bool HasListings { get; set; }

View File

@ -62,7 +62,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
new OsuSpriteText
{
Text = group.ShortName,
Colour = Color4Extensions.FromHex(group.Colour),
Colour = Color4Extensions.FromHex(group.Colour ?? Colour4.White.ToHex()),
Shadow = false,
Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true)
}