NullReferenceException: Object reference not set to an instance of an object (19647)

Hi guys, I'm wondering why am I getting this error at line 26? If I take off the "myText.enabled = false;" part then it works. But I want the text to disappear if the GameObject's Y rotation is between 270 and 0 or between 0 and 90.

var moveSpeed = 50;
private var yRotation = 0;
function Update () {
  var z = Input.GetAxis("Vertical") * Time.deltaTime * moveSpeed;
  transform.Translate(0, 0, z);

  if (Input.GetAxis("Horizontal"))
  {
    yRotation += Input.GetAxis("Horizontal") * 2;
    transform.eulerAngles = Vector3(0, yRotation, 0);

    if (transform.eulerAngles.y > 90 && transform.eulerAngles.y < 270)
    {
      var myText : GUIText = gameObject.Find ("Wrong Way").GetComponent ("GUIText");
      myText.enabled = true;
    }
    if (transform.rotation.y < 90 || transform.rotation.y > 270)
    {
      myText.enabled = false;
    }
  }
}

function Update () {
 if (Input.GetButtonUp("Fire1"))
    {
      var myText : GUIText = gameObject.Find ("Wrong Way").GetComponent ("GUIText");

      myText.enabled = true;
    }
    if (Input.GetButtonUp ("Fire2"))
    {
      myText.enabled = false;
    }
  }

Doesn't work. But.

function Update () {
 var myText : GUIText = gameObject.Find ("Wrong Way").GetComponent ("GUIText");
 if (Input.GetButtonUp("Fire1"))
    {

     myText.enabled = true;
    }
    if (Input.GetButtonUp ("Fire2"))
    {
      myText.enabled = false;
    }
  }

Does work. Just put the var myText line outside of the if statement. =).

You declare the var myText in one if() and then reference it in the next. Put the var myText : GUIText..... line three lines higher and you should be good.