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
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}