NullReferenceException

I am making a third person controller. My script is as follows-

var speed = 3.0;
var rotateSpeed = 3.0;

function Update ()
{
var controller : CharacterController = GetComponent(CharacterController);

// Rotate around y - axis
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);


// Move forward / backward
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);
}

I am getting the error -

NullReferenceException: Object reference not set to an instance of an object
move around.Update () (at Assets/move around.js:14)

Hard to say without seeing what the line numbers are but I would imagine your controller is null - is the CharacterController attached to the same GameObject as this script?