1
0
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:
Dean Herbert 2019-12-15 02:36:49 +09:00
parent 63c13ca1eb
commit 41d4609c92

View File

@ -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>();