diff --git a/Assets/Fungus/UI/Scripts/EventHandlers/ButtonClicked.cs b/Assets/Fungus/UI/Scripts/EventHandlers/ButtonClicked.cs index 35ee6213..173fc5b2 100644 --- a/Assets/Fungus/UI/Scripts/EventHandlers/ButtonClicked.cs +++ b/Assets/Fungus/UI/Scripts/EventHandlers/ButtonClicked.cs @@ -15,7 +15,10 @@ namespace Fungus public virtual void Start() { - targetButton.onClick.AddListener(OnButtonClick); + if (targetButton != null) + { + targetButton.onClick.AddListener(OnButtonClick); + } } protected virtual void OnButtonClick()