1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 15:33:05 +08:00

Add invocation null checks for safety

This commit is contained in:
Dean Herbert 2019-09-25 22:14:42 +09:00
parent 42fd323020
commit 45f833ceea

View File

@ -18,7 +18,7 @@ namespace osu.Game.Graphics.UserInterface
public BackButton(Receptor receptor) public BackButton(Receptor receptor)
{ {
receptor.OnBackPressed = () => Action.Invoke(); receptor.OnBackPressed = () => Action?.Invoke();
Size = TwoLayerButton.SIZE_EXTENDED; Size = TwoLayerButton.SIZE_EXTENDED;
@ -60,7 +60,7 @@ namespace osu.Game.Graphics.UserInterface
switch (action) switch (action)
{ {
case GlobalAction.Back: case GlobalAction.Back:
OnBackPressed.Invoke(); OnBackPressed?.Invoke();
return true; return true;
} }