mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 05:22:54 +08:00
Fix crash on trying to retrieve mods from unavailable ruleset
This commit is contained in:
parent
63c13ca1eb
commit
41d4609c92
@ -246,8 +246,11 @@ namespace osu.Game
|
||||
{
|
||||
var dict = new Dictionary<ModType, IReadOnlyList<Mod>>();
|
||||
|
||||
foreach (ModType type in Enum.GetValues(typeof(ModType)))
|
||||
dict[type] = r.NewValue?.CreateInstance().GetModsFor(type).ToList();
|
||||
if (r.NewValue?.Available == true)
|
||||
{
|
||||
foreach (ModType type in Enum.GetValues(typeof(ModType)))
|
||||
dict[type] = r.NewValue.CreateInstance().GetModsFor(type).ToList();
|
||||
}
|
||||
|
||||
if (!SelectedMods.Disabled)
|
||||
SelectedMods.Value = Array.Empty<Mod>();
|
||||
|
Loading…
Reference in New Issue
Block a user