1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Add a default icon when a ruleset isn't present

This commit is contained in:
Dean Herbert 2017-10-23 16:56:29 +09:00
parent df20845fbb
commit e7931ef4c7

View File

@ -35,7 +35,8 @@ namespace osu.Game.Beatmaps.Drawables
new ConstrainedIconContainer
{
RelativeSizeAxes = Axes.Both,
Icon = beatmap.Ruleset.CreateInstance().CreateIcon()
// the null coalesce here is only present to make unit tests work (ruleset dlls aren't copied correctly for testing at the moment)
Icon = beatmap.Ruleset?.CreateInstance().CreateIcon() ?? new SpriteIcon { Icon = FontAwesome.fa_question_circle_o }
}
};
}