mirror of https://github.com/ppy/osu
Remove null checks on `CreateInstance()` calls
This commit is contained in:
parent
8d69ebd7db
commit
0eea026afb
|
@ -117,7 +117,7 @@ private void load(RulesetStore rulesets)
|
|||
Spacing = new Vector2(1, 0);
|
||||
Direction = FillDirection.Horizontal;
|
||||
|
||||
var icon = rulesets.GetRuleset(rulesetId)?.CreateInstance()?.CreateIcon() ?? new SpriteIcon { Icon = FontAwesome.Regular.QuestionCircle };
|
||||
var icon = rulesets.GetRuleset(rulesetId)?.CreateInstance().CreateIcon() ?? new SpriteIcon { Icon = FontAwesome.Regular.QuestionCircle };
|
||||
Add(icon.With(i =>
|
||||
{
|
||||
i.Size = new Vector2(14);
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||
{
|
||||
public class RulesetBindingsSection : SettingsSection
|
||||
{
|
||||
public override Drawable CreateIcon() => ruleset?.CreateInstance()?.CreateIcon() ?? new SpriteIcon
|
||||
public override Drawable CreateIcon() => ruleset?.CreateInstance().CreateIcon() ?? new SpriteIcon
|
||||
{
|
||||
Icon = OsuIcon.Hot
|
||||
};
|
||||
|
|
|
@ -33,7 +33,7 @@ private void load(EditorBeatmap beatmap)
|
|||
new DesignSection(),
|
||||
};
|
||||
|
||||
var rulesetSpecificSection = beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateEditorSetupSection();
|
||||
var rulesetSpecificSection = beatmap.BeatmapInfo.Ruleset?.CreateInstance().CreateEditorSetupSection();
|
||||
if (rulesetSpecificSection != null)
|
||||
sectionsEnumerable.Add(rulesetSpecificSection);
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ public class IssueList : CompositeDrawable
|
|||
private void load(OverlayColourProvider colours)
|
||||
{
|
||||
generalVerifier = new BeatmapVerifier();
|
||||
rulesetVerifier = beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateBeatmapVerifier();
|
||||
rulesetVerifier = beatmap.BeatmapInfo.Ruleset?.CreateInstance().CreateBeatmapVerifier();
|
||||
|
||||
context = new BeatmapVerifierContext(beatmap, workingBeatmap.Value, verify.InterpretedDifficulty.Value);
|
||||
verify.InterpretedDifficulty.BindValueChanged(difficulty => context.InterpretedDifficulty = difficulty.NewValue);
|
||||
|
|
|
@ -282,9 +282,6 @@ private void updateBeatmapStatistics(RealmBeatmap beatmap, IBeatmap decoded)
|
|||
{
|
||||
var rulesetInstance = ((IRulesetInfo)beatmap.Ruleset).CreateInstance();
|
||||
|
||||
if (rulesetInstance == null)
|
||||
return;
|
||||
|
||||
decoded.BeatmapInfo.Ruleset = rulesetInstance.RulesetInfo;
|
||||
|
||||
// TODO: this should be done in a better place once we actually need to dynamically update it.
|
||||
|
|
Loading…
Reference in New Issue