Browse Source

Merge pull request #351 from FungusGames/button-click-null-check

Added null check in ButtonClicked event handler
master
Chris Gregan 9 years ago
parent
commit
4a8cb2432b
  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() public virtual void Start()
{ {
targetButton.onClick.AddListener(OnButtonClick); if (targetButton != null)
{
targetButton.onClick.AddListener(OnButtonClick);
}
} }
protected virtual void OnButtonClick() protected virtual void OnButtonClick()

Loading…
Cancel
Save