From 63ec36b3be32b58af43a5e5a99ebc875b9ad5f68 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 11 Jun 2018 12:57:56 +0900 Subject: [PATCH] Explicitly handle null settings case + add annotations --- osu.Game/Rulesets/UI/RulesetContainer.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 561e77b0c9..f604e876e7 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -13,6 +13,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using JetBrains.Annotations; using osu.Framework.Configuration; using osu.Framework.Graphics.Cursor; using osu.Framework.Input; @@ -86,16 +87,19 @@ namespace osu.Game.Rulesets.UI } [BackgroundDependencyLoader(true)] - private void load(OnScreenDisplay onScreenDisplay, SettingsStore settings) + private void load([CanBeNull] OnScreenDisplay onScreenDisplay, [CanBeNull] SettingsStore settings) { this.onScreenDisplay = onScreenDisplay; - rulesetConfig = CreateConfig(Ruleset, settings); - - if (rulesetConfig != null) + if (settings != null) { - dependencies.Cache(rulesetConfig); - onScreenDisplay?.BeginTracking(this, rulesetConfig); + rulesetConfig = CreateConfig(Ruleset, settings); + + if (rulesetConfig != null) + { + dependencies.Cache(rulesetConfig); + onScreenDisplay?.BeginTracking(this, rulesetConfig); + } } }