How do I fix this Null Reference error and update my score?

Hello, I’m trying to get my score to update when my enemy is destroyed, but I keep getting a NullReferenceException: Object reference not set to an instance of an object error. I have the following HealthScript attached to my enemy:

public void Damage(int damageCount)//Inflicts damage
	
{
    		hp -= damageCount;
    
    		if (hp <= 0) {
    			ScoreScript score = GetComponent<ScoreScript> ();
    			score.UpdateScore (5);
    			Destroy (gameObject); //destroy enemy
    			}
    				}

Then, I have the following ScoreScript attached to my player:

public void	UpdateScore(int scoreToAdd){
				score += scoreToAdd;
				}

The “score” is a public static int and seems to be recognized as such. What am I doing wrong?

is store a static int in Scorescript if it is you can do it like that

 if (hp <= 0) {
            ScoreScript.score+=5;
            Destroy (gameObject); //destroy enemy
            }

May be the damage fn calls after its destoryed.