NullReferenceException: Object reference not set to an instance of an object

I’m getting the following two errors and I’m not sure why.
NullReferenceException: Object reference not set to an instance of an object
Sugarrush.Update () (at Assets/Scripts/Sugarrush.cs:19)

NullReferenceException: Object reference not set to an instance of an object
Gamefunctions.Update () (at Assets/Scripts/Gamefunctions.cs:23)

using UnityEngine;
using System.Collections;

public class Sugarrush : MonoBehaviour {

    public float rushbar = 60f;
    float startTime;
    TextMesh rushText;

    // Use this for initialization
    void Start () {
        rushText = GetComponent<TextMesh>();
        startTime = rushbar;
    }
    // Update is called once per frame
    void Update () {
        if (rushbar > 0f)
        rushbar -= Time.deltaTime;
        rushText.text = rushbar.ToString("0.0");
    }
    void OnGUI() {
        //paramaters are position, width, height, title
        GUI.Box(new Rect(10, 10, (Screen.width * (rushbar) / startTime) / 3,  20), "rushbar");
    }
}

using UnityEngine;
using System.Collections;

public class Gamefunctions : MonoBehaviour {


	// varable to use for accessing the sugarrush script
	private Sugarrush  srscript;

	public float timer = 60f;
    public float startTime;
    private TextMesh timerText;

	// Use this for initialization
	void Start () {
		srscript = gameObject.GetComponent<Sugarrush>();
		timerText = GetComponent<TextMesh>();
        startTime = timer;
	}
	// Update is called once per frame
	void Update () {

		if(srscript.rushbar <= 0){
			Application.LoadLevel("death_Screen");
		}
		if (timer > 0f)
            timer -= Time.deltaTime;

        timerText.text = timer.ToString("0.0");

	}
	// inventory function array
	//void CheckInvetory (){
	//	string[] inventory = new string[5] {
	//		"GumGun", "WaterPistol", "sleageHammer"
	//	};
	//	foreach(string items in inventory){
	//		Debug.Log(items);
	//	}
	//}
    void OnGUI() {
        GUI.Box(new Rect(10, 10, (Screen.width * (startTime - timer) / startTime),  20), timer + "/" + startTime);
    }
}

It is helpful that you put a comment on where the errors are occurring, because the numbering system when you copy/paste code isn’t very helpful.

But I assume the first one is rushText = GetComponent(); - rushText could be null after that, if so then using it like rushText.text will throw at you that error (NullReferenceException means that you object is null, and you’re accessing stuff in it)
Check to see if it’s null after you assign it:

rushText = GetComponent<TextMesh>();
if (rushText == null)
{
   print("TEXT IS NULL, DO SOMETHING ABOUT IT, MAKE SURE THIS GAME OBJECT HAS A TextMesh component");
}

You might also have the same thing with srscript in your next script, but my guess is, since you’re having 2 errors in two places, I think it’s also from rushText otherwise you would have gotten 3 errors.