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:
parent
42fd323020
commit
45f833ceea
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user