Calling method doesn't work

Hey
I made simple animation which starts on space click.

private HappeningOnClick happen;
private Animator anim;
int buttonHash = Animator.StringToHash("GuzikAnimation");

void Start () {
	anim = GetComponent<Animator>();
	happen = GetComponent<HappeningOnClick>();
}

void Update () {

	if (Input.GetKeyDown (KeyCode.Space)) {
		anim.Play(buttonHash);
		happen.WhatHappensOnClick();

	}

}`

I called method WhatHappensOnClick (which destroy objects) from HeppeningOnClick Class.

	public void WhatHappensOnClick(){
		Destroy(gameObject);	
	}

	void Start () {
	}
	void Update () {

	}

This method only works in Update method in HeppeningOnClick Class. I don’t know why.
Errors:
NullReferenceException: Object reference not set to an instance of an object
PressButton.Update () (at Assets/PressButton.cs:19)

public void WhatHappensOnClick(){
Destroy(gameObject);
}

     void Start () {
     }
     void Update () {
 
     }

Um did you assign the object gameObject to anything?
Not familiar with C# but you need to assign “gameObject” to a GameObject if you haven’t.