Browse Source

Added null check in ButtonClicked event handler

master
chrisgregan 9 years ago
parent
commit
5b21b661e0
  1. 5
      Assets/Fungus/UI/Scripts/EventHandlers/ButtonClicked.cs

5
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()

Loading…
Cancel
Save