1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-08 00:02:54 +08:00

Fix possible nullrefs

This commit is contained in:
smoogipoo 2020-03-31 16:57:58 +09:00
parent 1952fcc0ce
commit 3cd353d387

View File

@ -81,15 +81,15 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
} }
}; };
var holdNote = (DrawableHoldNote)drawableObject;
if (drawableObject != null) if (drawableObject != null)
{ {
var holdNote = (DrawableHoldNote)drawableObject;
AccentColour.BindTo(drawableObject.AccentColour); AccentColour.BindTo(drawableObject.AccentColour);
AccentColour.BindValueChanged(onAccentChanged, true); isHitting.BindTo(holdNote.IsHitting);
} }
isHitting.BindTo(holdNote.IsHitting); AccentColour.BindValueChanged(onAccentChanged, true);
isHitting.BindValueChanged(_ => onAccentChanged(new ValueChangedEvent<Color4>(AccentColour.Value, AccentColour.Value)), true); isHitting.BindValueChanged(_ => onAccentChanged(new ValueChangedEvent<Color4>(AccentColour.Value, AccentColour.Value)), true);
} }