diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs b/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs index 8c4dac03a3..66eba5890a 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs @@ -30,12 +30,11 @@ namespace osu.Game.Rulesets.Osu.Mods public void ApplyToDrawableHitObjects(IEnumerable drawables) { - //In the Tests for hidden the ReadFromConfig() void isn't called -> the following bindable is null - //It's too much work to get the Dependency Injection on the Tests to get the config for just this mod, so I just make sure - //the bindable isn't null foreach (var d in drawables.OfType()) { //Don't hide the first object ("drawables" are in a reverse order -> Last() ) + //If increaseFirstObjectVisibility is null then we're exectuing one of the tests for the hidden mod. Since it's too much + //work for just this interface to work on this tests (DI of the config..), I just make sure to not throw a null exception if (d == drawables.Last() && (increaseFirstObjectVisibility == null || increaseFirstObjectVisibility)) continue; d.ApplyCustomUpdateState += ApplyHiddenState;