Basic Object reference error

Sorry to be a pain.

How can I decipher the problem with this error from this very basic script.

`
#pragma strict

var Start_Player_Agility = 10;
var Start_Player_Weight = 100;
var Start_Player_Speed = 100;

var player: Transform;
var chMotor: CharacterMotor = player.GetComponent(CharacterMotor);

function Start () {

}

function Update () {

if (chMotor.IsJumping())
{ print("Player is jumping");
}

}
`

NullReferenceException: Object reference not set to an instance of an object
robo-istat.Update () (at Assets/robo-istat.js:20)

Thanks for all your help

your variable declaration for ‘chMotor’ cannot use GetComponent before runtime. Declare your variable, then do the GetComponent in Start:

var chMotor: CharacterMotor;

function Start()
{
     chMotor = player.GetComponent(CharacterMotor);
}