NullReferenceException: Object reference not set to an instance of an object

I cant by the love of all things good, understand why I get the error: NullReferenceException: Object reference not set to an instance of an object
block1.Update () (at Assets/block1.js:69)

this is the part of the script that seems to be wrong?

var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition);
var hit: RaycastHit;
if (Physics.Raycast (ray,hit,20) && hit.transform.tag== "DirtBlock" || hit.transform.tag=="GrassBlock" || hit.transform.tag=="GlassBlock" || hit.transform.tag=="StoneBlock" || hit.transform.tag=="Trigger"|| hit.transform.tag=="WoodPlank"|| hit.transform.tag=="Block"|| hit.transform.tag=="C4"){
if(EndOfAnimation == true){
if (Input.GetButtonDown("Fire1")){
Arm.animation.Play("Place");
var newBlock : GameObject = Instantiate (CurrentBlock, hit.collider.transform.position+hit.normal.normalized, hit.collider.transform.rotation);
}
}

The wierd thing is that everything is working as it is supposed to do? And the if sentence works as intended as well? Its just annoying getting the error, and I would like to get rid of it.

Logical error. The || operator as less priority than the && operator. Therefore, your were checking against hit.transform.tag=="GrassBlock" while hit could be null.

The correct syntax is (surrouding the || statements with parentheses):

if (Physics.Raycast (ray,hit,20) &&
    (hit.transform.tag == "DirtBlock"
    || hit.transform.tag == "GrassBlock"
    || hit.transform.tag == "GlassBlock"
    || hit.transform.tag == "StoneBlock"
    || hit.transform.tag == "Trigger"
    || hit.transform.tag == "WoodPlank"
    || hit.transform.tag == "Block"
    || hit.transform.tag == "C4"))
{
    // your code here
}

In a case like this, it is safer (and more readable) to write two nested if:

if (Physics.Raycast (ray,hit,20))
{
    String tag = hit.transform.tag;
    if (tag == "DirtBlock"
    || tag == "GrassBlock"
    || tag == "GlassBlock"
    || tag == "StoneBlock"
    || tag == "Trigger"
    || tag == "WoodPlank"
    || tag == "Block"
    || tag == "C4")
    {
        // your code here
    }
}