mirror of https://github.com/ppy/osu
Add invocation null checks for safety
This commit is contained in:
parent
42fd323020
commit
45f833ceea
|
@ -18,7 +18,7 @@ public class BackButton : VisibilityContainer
|
|||
|
||||
public BackButton(Receptor receptor)
|
||||
{
|
||||
receptor.OnBackPressed = () => Action.Invoke();
|
||||
receptor.OnBackPressed = () => Action?.Invoke();
|
||||
|
||||
Size = TwoLayerButton.SIZE_EXTENDED;
|
||||
|
||||
|
@ -60,7 +60,7 @@ public bool OnPressed(GlobalAction action)
|
|||
switch (action)
|
||||
{
|
||||
case GlobalAction.Back:
|
||||
OnBackPressed.Invoke();
|
||||
OnBackPressed?.Invoke();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue