Null Reference

Im trying to make a detection code for my player but
it gives me NullReferenceException: Object reference not set to an instance of an object

Here is my code:

var target : Transform;

function Update(){

var hit : RaycastHit;
      
      var fwd = transform.TransformDirection (Vector3.forward);
      
       if (Physics.Raycast (transform.position, fwd, 100)) {
       
        if(hit.collider.tag == "Enemy"){
         
         if(target.renderer.isVisible){
           isZoomed = true;
         }
       }
      } 
}

You need the another overload of that function to fill the hit variable:

      if (Physics.Raycast(transform.position, fwd, out hit, 100.0F))