Why Unity show error: NullReferenceException?

http://unity3d.com/earn/tutorials/projects/space-shooter/moving-the-player

PlayerController.cs

using UnityEngine;
using System.Collections;

[System.Serializable]
public class Boundary{
	public float xMin, xMax, zMin, zMax;
}
public class PlayerController : MonoBehaviour {
	public float speed;
	public float tilt;
	public Boundary boundary;
	void FixedUpdate ()
	{
		float moveHorizontal = Input.GetAxis ("Horizontal");
		float moveVertical = Input.GetAxis ("Vertical");
		Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
		rigidbody.velocity = movement * speed;

		rigidbody.position =new Vector3 
	 (
				Mathf.Clamp (rigidbody.position.x, boundary.xMin, boundary.xMax), 
				0.0f, 
				Mathf.Clamp (rigidbody.position.z, boundary.zMin, boundary.zMax)
	   );
	  rigidbody.rotation = Quaternion.Euler (0.0f, 0.0f, rigidbody.velocity.x * -tilt);
	}
}

Unity3d show some error:
NullReferenceException: Object reference not set to an instance of an object
PlayerController.FixedUpdate () (at Assets/Scripts/PlayerController.cs:17)

rigidbody.velocity assign attempt for ‘Player’ is not valid. Input velocity is { 0.000000, 0.000000, NaN }.
UnityEngine.Rigidbody:set_velocity(Vector3)
PlayerController:FixedUpdate() (at Assets/Scripts/PlayerController.cs:16)

!CompareApproximately (det, 1.0F, .005f)
UnityEditor.SceneView:.cctor()
UnityEditorInternal.InternalEditorUtility:LoadSerializedFileAndForget(String)
UnityEditor.EditorApplicationLayout:SetStopmodeLayout()

Why? Can you help me?

I completely overlooked the NaN return.

To check for a NaN just use this code.

float.IsNaN(moveVertical)