Please help me with a gravity problem

I want to enable gravity on cubes when clicked. This is what I have so far but it’s telling me “Object Reference not set to an instance of an object.” Can anyone tell me how to fix this explicitly? I’m extremely new to Unity and coding. Thanks in advance.

function Update ()
{
if ( Input.GetMouseButtonDown(0) )
{
var hit : RaycastHit;
var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition);
if (Physics.Raycast (ray, hit, 10000.0))
{
if (hit.collider.gameObject.tag==“highlightableObject”) {
hit.collider.gameObject.GetComponent(“RigidBody”).useGravity = true;

	}
}

}
}

Sorry to clog up valuable space, I resolved the problem.