Fix test scene and remove "impossible" nullable coalesce

This commit is contained in:
Dean Herbert 2021-10-29 18:22:23 +09:00
parent 7db8bdfb7c
commit 07e3ced315
2 changed files with 3 additions and 1 deletions

View File

@ -15,6 +15,7 @@ using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu;
using osu.Game.Screens.Select;
using osu.Game.Screens.Select.Carousel;
using osu.Game.Screens.Select.Filter;
@ -868,6 +869,7 @@ namespace osu.Game.Tests.Visual.SongSelect
OnlineBeatmapID = id++ * 10,
Version = version,
StarDifficulty = diff,
Ruleset = new OsuRuleset().RulesetInfo,
BaseDifficulty = new BeatmapDifficulty
{
OverallDifficulty = diff,

View File

@ -131,7 +131,7 @@ namespace osu.Game.Beatmaps.Drawables
private Drawable getRulesetIcon()
{
int? onlineID = (ruleset ?? beatmapInfo.Ruleset)?.OnlineID;
int? onlineID = (ruleset ?? beatmapInfo.Ruleset).OnlineID;
if (onlineID >= 0 && rulesets.GetRuleset(onlineID.Value)?.CreateInstance() is Ruleset rulesetInstance)
return rulesetInstance.CreateIcon();