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
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 public class APIUserGroup
{ {
[JsonProperty(@"colour")] [JsonProperty(@"colour")]
public string Colour { get; set; } = null!; public string? Colour { get; set; }
[JsonProperty(@"has_listing")] [JsonProperty(@"has_listing")]
public bool HasListings { get; set; } public bool HasListings { get; set; }

View File

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