Made getPlanet(int) better

Defensive programming.