Object Reference not set to an instance of an object

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class GameController : MonoBehaviour {
//Public Variables
public int numberOfCubes;
public GameObject cube;
public Text scoreText;

	//Private Variables
	private int score;
	private int amountOfPoints;
	private int totalCubes;
	private Rarity rarity;
	private int timeLimit = 0;
	private bool gameOver = false;
	private int timeLeft = 0;
	// Use this for initialization
	void Start() {
		totalCubes = 0;
		score = 0;
		UpdateScore ();
		StartCoroutine (Spawn(.1F));
		StartCoroutine (TimeLimit());
	}

	void Update()
	{
		if (numberOfCubes > totalCubes)
		{
			Vector2 position = new Vector2 (Random.Range (-5.0F, 5.0F), Random.Range (-5.0F, 5.0F));
			Instantiate (cube, position, Quaternion.identity);
			totalCubes++;
		}
		if (timeLeft == 20)
		{
			gameOver = true;
		}
		//Debug.Log (amountOfPoints.ToString ());
	}
	IEnumerator Spawn (float waitTime)
	{
		while (timeLeft != 60)
		{
			yield return new WaitForSeconds (waitTime);
			Vector2 position = new Vector2 (Random.Range (-5.0F, 5.0F), Random.Range (-5.0F, 5.0F));
			Instantiate (cube, position, Quaternion.identity);

		}
	}
	IEnumerator TimeLimit()
	{

		while(gameOver == false)
		{
		yield return new WaitForSeconds (1);
		timeLeft += 1;
		//Debug.Log (timeLeft.ToString ());
		}
	}


	public void AddScore(int newScoreValue)
	{
		score += newScoreValue;
		UpdateScore ();
	}
	void UpdateScore()
	{
		print(scoreText.text = "Score: " + score);
	}

}

Heres my first Code

using UnityEngine;
using System.Collections;

public class MouseOver : MonoBehaviour {
	private int points1 = 1;
	private int points2 = 2;
	private int points3 = 3;
	private int totalPoints;
	private GameController gameController;
	void Start()
	{
		//GameObject gameControllerObject = GameObject.FindGameObjectWithTag ("GameController");
		//gameController = gameObject.GetComponent<GameController> ();
		GameObject gameControllerObject = GameObject.Find ("GameController");
		totalPoints = 0;
	}
	void OnMouseOver()
	{
		if (this.gameObject.tag == "Cube1")
		{
			//gameController.AddScore (points1);
			totalPoints += points1;
		}
		if (gameObject.tag == "Cube2")
		{
			//gameController.AddScore (points2);
			totalPoints += points2;
		}
		if (gameObject.tag == "Cube3")
		{
			//gameController.AddScore (points3);
			totalPoints += points3;
		}
		Destroy (gameObject);
		//print ("Points " + totalPoints.ToString ());
		Debug.Log ("points: " + totalPoints.ToString ());


	}
	void Update()
	{
		gameController.AddScore (totalPoints);
	}
		
}

Here is my second code and the error I a getting is: NullReferenceException: Object reference not set to an instance of an object
MouseOver.Update () (at Assets/Scripts/MouseOver.cs:42)

@shelbyk342

Replace your Start() function in MouseOver with this one

void Start()
{
    //GameObject gameControllerObject = GameObject.FindGameObjectWithTag ("GameController");
    //gameController = gameObject.GetComponent<GameController> ();
    GameObject gameControllerObject = GameObject.Find ("GameController");
    if (gameControllerObject == null)
    {
        DebugLogError("Unable to find a GameObject named GameController");
    }
    totalPoints = 0;
}

And when you want to access gameControllerObject do it like this

if (gameControllerObject != null)
{
    gameController.AddScore (totalPoints);
}