Modify a value from another script ( no static value )

It take me over 2 days searched Google and have see more similar but still i don’t get any working code.

I have 2 objects called Dog and Vase, with each object have their script. When Hero OnEnterCollision2D with Vase, the Vase broken and the Dog move to the Vase. The problem is the dog only move 1 time and my solution is modify a bool value ( this value must not be static because i must using this.).
Here is the Trap.cs

    void Update () {
    		if (hit && !breaked) 
    		{
			
			if(this.tag == "chuoi")
			{
				//Dont care about here, just something....
			}
			else if(this.tag == "xo")
			{
				Debug.Log("Ban vua tam mien phi");
				anim.SetBool("hit",true);
				hit = false;
				//Here it not working, i wanna modify wakeUp in Dog.cs
				Dog dog = gameObject.GetComponent<Dog> ();
				dog.wakeUp = true;

				breaked = true;
				posBreak = transform.position;

			}

And the `Dog.cs`
public class Dog : MonoBehaviour {
    	public bool hitWall;
    	public bool wakeUp;

	void Update () {
		//Debug.Log ("hitWall " + hitWall);
		//Debug.Log ("onWakeUp " + onWakeUp);
		if (wakeUp && !hitWall) 
		{
			Debug.Log ("Ban vua danh thuc con cho");
			this.transform.position = Vector2.MoveTowards (transform.position, TrapManager.posBreak, speed * Time.deltaTime);
			if(this.hitWall )
			{
				this.transform.position = Vector2.MoveTowards (transform.position, transform.position, 0);
			}
		} 

	}

	void OnCollisionEnter2D(Collision2D col)
	{
		if (col.gameObject.tag == "wall") {
                        //Here that why i wanna modify wakeUp value, i just only wanna stop move the dogs which was collision with walls, not all the dogs, so this.wakeUp is required
			this.hitWall = true;
			this.wakeUp = false;
			Debug.Log("Cho vua dung tuong");
		}

When run, i got “Object reference not set to an instance object”. Sorry for stupid question, i’m new in Unity, and search not solve my problem, so please help.
Thank you.

You can only use this.GetComponent<SomeType>() if component SomeType is attached onto current gameobject, otherwise it will return NULL. if you want to access Dog.cs from Trap.cs you can create: public GameObject DogObject; in trap.cs, assign Dog game object to this variable through editor and then you can use: Dog DogEntity = this.GetComponent(); in Trap.cs