mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:17:26 +08:00
Fix GroupBadge
crashing on null
group colour
This commit is contained in:
parent
7782bfb80b
commit
660bf748d5
@ -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; }
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user