NullReferenceException problem

I keep getting this NullReferenceException:Object reference not set to an instance of an object Bullet_Hit_Boss.OnTriggerEnter (UnityEngine.Collider.col) (at Assets/Scripts/Bullet_Hit_Boss.cs:16), but on the code below the actual part that is supposidly wrong is the “healthbar.CurHealth -=20;” …Really cant work out why it wont work! Have practically same scripts in use eleswhere and they work fine! Any help would be appreciated, heres the two scripts being used…

public class Bullet_Hit_Boss : MonoBehaviour
{

void OnTriggerEnter(Collider col)
{		
	
	if(col.gameObject.tag == "Boss") 
	{
		
		Debug.Log("Bullet Hit Boss !"); // outputs to console
		
		Boss healthbar = GetComponent<Boss>();
		healthbar.CurHealth -= 20;
		Debug.Log("Health Decreased !");
		
		Destroy(gameObject);
	}

}

}

public class Boss : MonoBehaviour
{

public int maxHealth = 100;
public int CurHealth = 100;

 
public GUISkin HealthBar; 
//public GUISkin HealthBarStay;

public float healthBarLength;
//public float healthBarLengthStay;


public bool GUIdisplayed;

// Use this for initialization
void Start () 
{
   GUIdisplayed = true;
   healthBarLength = Screen.width /3;
 //  healthBarLengthStay = Screen.width /3;
}

// Update is called once per frame
void Update () 
{
	 AdjustCurrentHealth(0);
}

void OnGUI()
{

//	GUI.skin = HealthBarStay;
//GUI.Box (new Rect(20,400, healthBarLengthStay, 14), curHealth + "/" + maxHealth); 
	
if(GUIdisplayed == true)
{
	GUI.skin = HealthBar;

	GUI.Box (new Rect(Screen.width/ 10 * 3.5f, Screen.height/ 10 * 6f ,     healthBarLength, 50),""); // From Right, From Top, Length, Height
}

}

public void AdjustCurrentHealth(int adj)
{

CurHealth += adj;

   if(CurHealth <0)
	{
		CurHealth = 0;
	}

   if(CurHealth > maxHealth)
     CurHealth = maxHealth;

   if(maxHealth <1)
     maxHealth = 1;


   healthBarLength =(Screen.width /3) * (CurHealth / (float)maxHealth);

}

}

In this line:

Boss healthbar = GetComponent<Boss>();

You are trying to get the component Boss from your class’ GameObject.
The function GetComponent returns the component (if found) or null if not.

Probably it is returning null, and then the NullReferenceException is thrown when you try to update CurHealth here:

healthbar.CurHealth -= 20;

Check if the GameObject you are trying to GetComponent<>() really has the component Boss.

Edit: The GameObject you need to get the component Boss in this case is the collider’s gameObject.

To fix it, change this:

Boss healthbar = GetComponent<Boss>();

to that:

Boss healthbar = col.gameObject.GetComponent<Boss>();