Definition problem

I have a very complex and complicated script.(consist of more scripts actually, but lets focus on this single one)But cut down, I want to activate another public void in another script from this one:
The problem is that, when I run PickMeUp I get a NullRefferenceException error. It apears that I havent defined the PrivatePositionUpdate variable.

public GameObject ThisGameobject;
public Private_position_Update PrivatePositionUpdate;
public GameObject[] obstacles ;

void Awake()
{
	obstacles = GameObject.FindGameObjectsWithTag("obstacle");
	Debug.Log(obstacles);
}
void PickMeUp()
{
	foreach (GameObject _obstacle in obstacles) {
        PrivatePositionUpdate = _obstacle.GetComponent<Private_position_Update>();
		Destroy(ThisGameobject);
		PrivatePositionUpdate.RemoveOfGadget();
    }
	
}

}

You need to have a script/class called Private_position_Update added to your obstacle gameobject.

Also I suggest checking if _obstacle is not null, and if PrivatePositionUpdate is not null.

Also why you are naming a class ‘Private_position_Update’ is beyond me.