1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:47:24 +08:00

Fix GroupBadge crashing on null group colour

This commit is contained in:
StanR 2023-01-14 02:23:08 +03:00
parent 7782bfb80b
commit 660bf748d5
2 changed files with 3 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

@ -1,6 +1,7 @@
// 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.
using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
@ -62,7 +63,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)
}