1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-10 00:42:57 +08:00

Check nulls

This commit is contained in:
recapitalverb 2020-03-18 00:15:43 +07:00
parent d18b21ba32
commit 431571dfa0

View File

@ -51,6 +51,7 @@ namespace osu.Game.Screens.Ranking.Expanded
{
var beatmap = working.Value.BeatmapInfo;
var metadata = beatmap.Metadata;
var creator = beatmap.Metadata.Author?.Username;
var topStatistics = new List<StatisticDisplay>
{
@ -162,8 +163,11 @@ namespace osu.Game.Screens.Ranking.Expanded
Direction = FillDirection.Horizontal,
}.With(t =>
{
t.AddText("mapped by ");
t.AddText(metadata.Author.Username, s => s.Font = s.Font.With(weight: FontWeight.SemiBold));
if (!string.IsNullOrEmpty(creator))
{
t.AddText("mapped by ");
t.AddText(creator, s => s.Font = s.Font.With(weight: FontWeight.SemiBold));
}
})
}
},