Why do I get a null reference when trying to assign a value to an instance?

I’m trying to create an object add a variable and add it to a list, but Unity seems to make a very simple thing very hard to do. I’ve tried every example in the manuals and forums but still can’t get it to work.

void Start () {

		GameObject pl1 = Instantiate(Resources.Load("Planet"),new Vector3(0,0,0),Quaternion.identity) as GameObject;

		Planet pl =  pl1.GetComponent<Planet>();		
		pl.planetName = "Earth";
		
		planetList.Add(pl1);

}

I get NullReferenceException: Object reference not set to an instance of an object when doing pl.planetName

This means that the gameobject does not have the planet script attached. Make sure it is on the same gameobject and not a child or parent of the gameobject pl1.