NullReferenceException, I don't understand why.

Ok so I’m trying to add attributes that change the characters statistics. I have the character page where the attributes are displayed, I’m trying to change some text so its says how many points are in the attribute but I keep getting the null reference exception error when I have already called it.

	void SetAttributes () {
		Attributes attribs = GetComponent<Attributes> ();

		if (isVit == true)
						GetComponent<TextMesh> ().text = attribs.vitality.ToString ();

vitality is just a public int at the top of a class on another script set to 5.

Right the Dontdestroyonload wasn’t working for me, in the end I took out mono behaviour from the attributes script and made the variables static and called the like this

	Attributes.vitality 

very simple, probably why nobody said it :S
I got it from this link here if someone else needs it: