Using OnPointerClick with Buttons

Presently I’m using a separate Script attached to each Button in order to capture clicks and run a function in my main script.

The problem I’m having is that while using the left button, handled by “PointerEventData.InputButton.Left” my function works perfectly, but using “PointerEventData.InputButton.Right” causes the function to return a NullRefferenceException. Yet, the .Right code works if I first left click the Button, and then Right click it. (both with the .Left code removed and when it’s there)

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
 
public class ClickableObject : MonoBehaviour, IPointerClickHandler
{
    public void OnPointerClick(PointerEventData eventData)
    {
        GameObject _GameControlerObj = GameObject.Find("_GameControlerObj");
        _GameControler gc = _GameControlerObj.GetComponent<_GameControler>();

        if (eventData.button == PointerEventData.InputButton.Left)
        {
            gc.DoSomething();
        }
        else if (eventData.button == PointerEventData.InputButton.Right)
        {
            gc.DoSomething();
        }
    }
}

I tried removing the Button component and adding a 2DBoxColider, just caused it to return exceptions on both left and right clicks.

I’m completely lost as to how to fix it, any ideas?

If it matters, the buttons are all created through script, and set to be children of a canvas. Event System is present as a child of the Canvas as well

If anyone else is having this problem, it turns out that Unity sometimes doesn’t feel like allowing you to update through the in-editor button.
Updating to 5.3.1 fixed the issue