Merge pull request #1557 from miterosan/Fix_osu_crashing_when_an_unknown_ruleset_is_selected_in_the_config

Fix osu crashing if a invalid gamerule is given in the game.ini
This commit is contained in:
Dean Herbert
2017-11-21 23:31:39 +09:00
committed by GitHub

View File

@ -109,7 +109,7 @@ namespace osu.Game
dependencies.Cache(this);
configRuleset = LocalConfig.GetBindable<int>(OsuSetting.Ruleset);
Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value);
Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First();
Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0;
}