Full impossible nullref

This commit is contained in:
Dean Herbert
2019-12-06 12:51:43 +09:00
parent 9248fbe881
commit b1426d1b22

View File

@ -16,23 +16,20 @@ namespace osu.Game.Screens.Edit.Compose
protected override Drawable CreateMainContent() protected override Drawable CreateMainContent()
{ {
var ruleset = Beatmap.Value.BeatmapInfo.Ruleset?.CreateInstance(); var ruleset = Beatmap.Value.BeatmapInfo.Ruleset?.CreateInstance();
composer = ruleset?.CreateHitObjectComposer(); composer = ruleset?.CreateHitObjectComposer();
if (composer != null) if (ruleset == null || composer == null)
{ return new ScreenWhiteBox.UnderConstructionMessage(ruleset == null ? "This beatmap" : $"{ruleset.Description}'s composer");
var beatmapSkinProvider = new BeatmapSkinProvidingContainer(Beatmap.Value.Skin);
// the beatmapSkinProvider is used as the fallback source here to allow the ruleset-specific skin implementation var beatmapSkinProvider = new BeatmapSkinProvidingContainer(Beatmap.Value.Skin);
// full access to all skin sources.
var rulesetSkinProvider = new SkinProvidingContainer(ruleset.CreateLegacySkinProvider(beatmapSkinProvider));
// load the skinning hierarchy first. // the beatmapSkinProvider is used as the fallback source here to allow the ruleset-specific skin implementation
// this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources. // full access to all skin sources.
return beatmapSkinProvider.WithChild(rulesetSkinProvider.WithChild(composer)); var rulesetSkinProvider = new SkinProvidingContainer(ruleset.CreateLegacySkinProvider(beatmapSkinProvider));
}
return new ScreenWhiteBox.UnderConstructionMessage(ruleset == null ? "This beatmap" : $"{ruleset.Description}'s composer"); // load the skinning hierarchy first.
// this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources.
return beatmapSkinProvider.WithChild(rulesetSkinProvider.WithChild(composer));
} }
protected override Drawable CreateTimelineContent() => new TimelineHitObjectDisplay(composer.EditorBeatmap); protected override Drawable CreateTimelineContent() => new TimelineHitObjectDisplay(composer.EditorBeatmap);