1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-11 06:32:54 +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 beatmap = working.Value.BeatmapInfo;
var metadata = beatmap.Metadata; var metadata = beatmap.Metadata;
var creator = beatmap.Metadata.Author?.Username;
var topStatistics = new List<StatisticDisplay> var topStatistics = new List<StatisticDisplay>
{ {
@ -161,9 +162,12 @@ namespace osu.Game.Screens.Ranking.Expanded
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
}.With(t => }.With(t =>
{
if (!string.IsNullOrEmpty(creator))
{ {
t.AddText("mapped by "); t.AddText("mapped by ");
t.AddText(metadata.Author.Username, s => s.Font = s.Font.With(weight: FontWeight.SemiBold)); t.AddText(creator, s => s.Font = s.Font.With(weight: FontWeight.SemiBold));
}
}) })
} }
}, },