Avoid potential crashes when lease is held on SelectedMods

This commit is contained in:
Dean Herbert 2021-02-05 16:46:21 +09:00
parent 3e750feaa4
commit 630c5bb747

View File

@ -469,6 +469,10 @@ namespace osu.Game
{
updateModDefaults();
// a lease may be taken on the mods bindable, at which point we can't really ensure valid mods.
if (SelectedMods.Disabled)
return;
if (!ModUtils.CheckValidForGameplay(mods.NewValue, out var invalid))
{
// ensure we always have a valid set of mods.